private void Delete() { // TODO: Delete [for deletion, loop while there are items to delete => then sleep) var items = _playerItemDao.GetItemsMarkedForOnlineDeletion(); if (items.Count > 0) { var ids = Uri.EscapeDataString(JsonConvert.SerializeObject(items.Select(m => m.OID))); var parameters = $"token={_token}&ids={ids}"; var result = Post(parameters, DeleteUrl); if (string.IsNullOrEmpty(result)) { Logger.Warn("Error removing items from remote backup server"); return; } var obj = JsonConvert.DeserializeObject <PlayerItemBackupDeleteResponse>(result); if (!obj.Success) { Logger.Warn($"Error {obj.ErrorCode} deleting items from online backup."); } else { if (_playerItemDao.ClearItemsMarkedForOnlineDeletion() != items.Count) { Logger.Warn($"Not all deletion tags were removed."); } else { Logger.Info("Remove backup server notified of deleted items"); } } } }
public int ClearItemsMarkedForOnlineDeletion() { return(ThreadExecuter.Execute( () => repo.ClearItemsMarkedForOnlineDeletion() )); }
public void ClearItemsMarkedForOnlineDeletion() { ThreadExecuter.Execute( () => _repo.ClearItemsMarkedForOnlineDeletion() ); }
public void ClearItemsMarkedForOnlineDeletion() { _playerItemDao.ClearItemsMarkedForOnlineDeletion(); }