public async Task <bool> RemoveHistoryAsync(IEnumerable <IVideoContent> watchHistoryItems) { try { var result = await _LoginUserVideoWatchHistoryProvider.RemoveHistoryAsync(watchHistoryItems.Select(x => x.VideoId)); if (result) { foreach (var item in watchHistoryItems) { WatchHistoryRemoved?.Invoke(this, new WatchHistoryRemovedEventArgs() { VideoId = item.VideoId }); } _notificationService.ShowLiteInAppNotification_Success("VideoHistory_DeleteOne_Success".Translate()); } else { _notificationService.ShowLiteInAppNotification_Success("VideoHistory_DeleteOne_Fail".Translate()); } return(result); } catch { _notificationService.ShowLiteInAppNotification_Success("VideoHistory_DeleteOne_Fail".Translate()); throw; } }
public async Task <bool> RemoveHistoryAsync(IVideoContent watchHistory) { try { var result = await _LoginUserVideoWatchHistoryProvider.RemoveHistoryAsync(watchHistory.VideoId); if (result) { WatchHistoryRemoved?.Invoke(this, new WatchHistoryRemovedEventArgs() { VideoId = watchHistory.VideoId }); _notificationService.ShowLiteInAppNotification_Success("VideoHistory_DeleteOne_Success".Translate()); } else { _notificationService.ShowLiteInAppNotification_Success("VideoHistory_DeleteOne_Fail".Translate()); } return(result); } catch { _notificationService.ShowLiteInAppNotification_Success("VideoHistory_DeleteOne_Fail".Translate()); throw; } }
public async Task <bool> RemoveHistoryAsync(IWatchHistory watchHistory) { var result = await _loginUserHistoryProvider.RemoveHistoryAsync(watchHistory.RemoveToken, watchHistory.ItemId); if (result.IsOK) { WatchHistoryRemoved?.Invoke(this, new WatchHistoryRemovedEventArgs() { ItemId = watchHistory.ItemId }); } return(result.IsOK); }