/// <inheritdoc/> public Video ReadVideo(string path) { var file = Mp4File.Open(path); var tags = file.Tags; if (tags is null) { throw new ArgumentException(default, nameof(path));
/// <inheritdoc/> public void UpdateEpisode(string fileName, Episode episode, IDictionary <MediaTrackType, string>?languages = default) { var file = Mp4File.Open(fileName); Update(file, episode, MediaKind.TVShow, languages); if (file.Tags is not null) { // episode file.Tags.EpisodeNumber = ValueOrNull(episode.Number); file.Tags.SeasonNumber = ValueOrNull(episode.Season); file.Tags.TVShow = episode.Show; file.Tags.EpisodeId = episode.Id; file.Tags.TVNetwork = episode.Network; file.Tags.ContentId = episode.Part; } file.Save();
/// <inheritdoc/> public void UpdateVideo(string fileName, Video video, IDictionary <MediaTrackType, string>?languages = default) { if (video is Episode episode) { this.UpdateEpisode(fileName, episode, languages); } else if (video is Movie movie) { this.UpdateMovie(fileName, movie, languages); } else { var file = Mp4File.Open(fileName); var mediaType = file.Tags is null ? MediaKind.NotSet : file.Tags.MediaType; Update(file, video, mediaType, languages); file.Save(); } }