public bool IsVideoPlayed(VideoId videoId, out VideoPlayHistoryEntry history) { var entry = _collection.FindById(videoId.ToString()); history = entry; return(entry?.PlayCount > 0); }
public NicoVideo Get(VideoId videoId) { return(_collection .Include(x => x.Owner) .FindById(videoId.ToString()) ?? new NicoVideo() { Id = videoId }); }
public async Task <IActionResult> REDIR(string id, string prefix) { try{ VideoId v = id; string newid = v.ToString(); return(Redirect(prefix + newid)); }catch (Exception) { return(NotFound("nope not avail")); } }
public VideoPlayHistoryEntry VideoPlayedIfNotWatched(VideoId videoId, TimeSpan playedPosition) { var history = _collection.FindById(videoId.ToString()); if (history != null) { return(history); } else { history = new VideoPlayHistoryEntry { VideoId = videoId, PlayCount = 1, LastPlayed = DateTime.Now, LastPlayedPosition = playedPosition }; } _collection.Upsert(history); return(history); }
public bool ExistPlaylistItem(string playlistId, VideoId videoId) { var videoIdStr = videoId.ToString(); return(_collection.Exists(x => x.PlaylistId == playlistId && x.ContentId == videoIdStr)); }
public bool DeletePlaylistItem(string playlistId, VideoId contentId) { var strId = contentId.ToString(); return(_collection.DeleteMany(x => x.PlaylistId == playlistId && x.ContentId == strId) > 0); }
public bool IsVideoPlayed(VideoId videoId) { return(_collection.FindById(videoId.ToString())?.PlayCount > 0); }
public VideoPlayHistoryEntry Get(VideoId videoId) { return(_collection.FindById(videoId.ToString())); }
public string GetNameFor(VideoId videoId) => videoId.ToString();