diff --git a/Shoko.Desktop/MainWindow.xaml.cs b/Shoko.Desktop/MainWindow.xaml.cs index 0ad855e8..ecf24263 100644 --- a/Shoko.Desktop/MainWindow.xaml.cs +++ b/Shoko.Desktop/MainWindow.xaml.cs @@ -78,11 +78,14 @@ private enum TAB_UTILITY Rankings }; - public static readonly int TAB_Settings_Essential = 0; - public static readonly int TAB_Settings_AniDB = 1; - public static readonly int TAB_Settings_TvDB = 2; - public static readonly int TAB_Settings_WebCache = 3; - public static readonly int TAB_Settings_Display = 4; + public enum TAB_Settings + { + Essential = 0, + AniDB, + TvDB, + WebCache, + Display + } private static System.Timers.Timer postStartTimer = null; @@ -849,7 +852,7 @@ void tabSettingsChild_SelectionChanged(object sender, SelectionChangedEventArgs if (e.Source is TabControl) { TabControl tab = e.Source as TabControl; - if (tab.SelectedIndex == TAB_Settings_Display) + if (tab.SelectedIndex == (int) TAB_Settings.Display) { if (VM_ShokoServer.Instance.SelectedLanguages.Count == 0) VM_ShokoServer.Instance.RefreshNamingLanguages(); } @@ -1346,7 +1349,7 @@ private void RefreshView() private void CommandBinding_EditTraktCredentials(object sender, ExecutedRoutedEventArgs e) { tabControl1.SelectedIndex = (int) TAB_MAIN.Settings; - tabSettingsChild.SelectedIndex = TAB_Settings_TvDB; + tabSettingsChild.SelectedIndex = (int) TAB_Settings.TvDB; } public void ShowPinnedFileAvDump(VM_VideoLocal vid) @@ -2027,9 +2030,9 @@ private void CommandBinding_Search(object sender, ExecutedRoutedEventArgs e) // move to all groups VM_MainListHelper.Instance.ShowAllGroups(); - if (e.Parameter is CL_AnimeTag) + if (e.Parameter is VM_AnimeTag) { - CL_AnimeTag obj = e.Parameter as CL_AnimeTag; + VM_AnimeTag obj = e.Parameter as VM_AnimeTag; txtGroupSearch.Text = obj.TagName; } diff --git a/Shoko.Desktop/Shoko.Desktop.csproj b/Shoko.Desktop/Shoko.Desktop.csproj index 4525497e..92f96023 100644 --- a/Shoko.Desktop/Shoko.Desktop.csproj +++ b/Shoko.Desktop/Shoko.Desktop.csproj @@ -289,6 +289,7 @@ + diff --git a/Shoko.Desktop/UserControls/AnimeSeries.xaml.cs b/Shoko.Desktop/UserControls/AnimeSeries.xaml.cs index 120f4604..ad055f5a 100644 --- a/Shoko.Desktop/UserControls/AnimeSeries.xaml.cs +++ b/Shoko.Desktop/UserControls/AnimeSeries.xaml.cs @@ -1,5 +1,4 @@ -using NLog; -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; @@ -9,17 +8,16 @@ using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; +using NLog; using Shoko.Commons.Extensions; using Shoko.Desktop.Forms; using Shoko.Desktop.Utilities; +using Shoko.Desktop.VideoPlayers; using Shoko.Desktop.ViewModel; using Shoko.Desktop.ViewModel.Server; using Shoko.Models.Client; using Shoko.Models.Enums; using Shoko.Models.Server; -using CustomTagCrossRefType = Shoko.Models.Enums.CustomTagCrossRefType; -using ImageEntityType = Shoko.Models.Enums.ImageEntityType; -using ImageSizeType = Shoko.Models.Enums.ImageSizeType; namespace Shoko.Desktop.UserControls { @@ -77,7 +75,7 @@ public double ImageListBoxWidthFull } public static readonly DependencyProperty SeriesPos_TvDBLinksProperty = DependencyProperty.Register("SeriesPos_TvDBLinks", - typeof(int), typeof(AnimeSeries), new UIPropertyMetadata((int)6, null)); + typeof(int), typeof(AnimeSeries), new UIPropertyMetadata(6, null)); public int SeriesPos_TvDBLinks { @@ -86,7 +84,7 @@ public int SeriesPos_TvDBLinks } public static readonly DependencyProperty SeriesPos_PlayNextEpisodeProperty = DependencyProperty.Register("SeriesPos_PlayNextEpisode", - typeof(int), typeof(AnimeSeries), new UIPropertyMetadata((int)6, null)); + typeof(int), typeof(AnimeSeries), new UIPropertyMetadata(6, null)); public int SeriesPos_PlayNextEpisode { @@ -95,7 +93,7 @@ public int SeriesPos_PlayNextEpisode } public static readonly DependencyProperty SeriesPos_TitlesProperty = DependencyProperty.Register("SeriesPos_Titles", - typeof(int), typeof(AnimeSeries), new UIPropertyMetadata((int)6, null)); + typeof(int), typeof(AnimeSeries), new UIPropertyMetadata(6, null)); public int SeriesPos_Titles { @@ -104,7 +102,7 @@ public int SeriesPos_Titles } public static readonly DependencyProperty SeriesPos_TagsProperty = DependencyProperty.Register("SeriesPos_Tags", - typeof(int), typeof(AnimeSeries), new UIPropertyMetadata((int)6, null)); + typeof(int), typeof(AnimeSeries), new UIPropertyMetadata(6, null)); public int SeriesPos_Tags { @@ -113,7 +111,7 @@ public int SeriesPos_Tags } public static readonly DependencyProperty SeriesPos_CustomTagsProperty = DependencyProperty.Register("SeriesPos_CustomTags", - typeof(int), typeof(AnimeSeries), new UIPropertyMetadata((int)7, null)); + typeof(int), typeof(AnimeSeries), new UIPropertyMetadata(7, null)); public int SeriesPos_CustomTags { @@ -156,40 +154,42 @@ public AnimeSeries() playlistMenu = new ContextMenu(); - cRating.OnRatingValueChangedEvent += new RatingControl.RatingValueChangedHandler(cRating_OnRatingValueChangedEvent); + cRating.OnRatingValueChangedEvent += cRating_OnRatingValueChangedEvent; - Loaded += new RoutedEventHandler(AnimeSeries_Loaded); - btnAnimeGroupShow.Click += new RoutedEventHandler(btnAnimeGroupShow_Click); - btnTvDBLinks.Click += new RoutedEventHandler(btnTvDBLinks_Click); + Loaded += AnimeSeries_Loaded; + btnAnimeGroupShow.Click += btnAnimeGroupShow_Click; + btnTvDBLinks.Click += btnTvDBLinks_Click; //btnPlayNextEpisode.Click += new RoutedEventHandler(btnPlayNextEpisode_Click); - + btnSwitchView.Click += BtnSwitchView_Click; - DataContextChanged += new DependencyPropertyChangedEventHandler(AnimeSeries_DataContextChanged); + DataContextChanged += AnimeSeries_DataContextChanged; - tabContainer.SelectionChanged += new SelectionChangedEventHandler(tabContainer_SelectionChanged); + tabContainer.SelectionChanged += tabContainer_SelectionChanged; - btnUpdateAniDBInfo.Click += new RoutedEventHandler(btnUpdateAniDBInfo_Click); - LayoutUpdated += new EventHandler(AnimeSeries_LayoutUpdated); + btnUpdateAniDBInfo.Click += btnUpdateAniDBInfo_Click; + LayoutUpdated += AnimeSeries_LayoutUpdated; - btnEditSeries.Click += new RoutedEventHandler(btnEditSeries_Click); - btnEditSeriesFinish.Click += new RoutedEventHandler(btnEditSeriesFinish_Click); + btnEditSeries.Click += btnEditSeries_Click; + btnEditSeriesFinish.Click += btnEditSeriesFinish_Click; - btnAnimeTitles.Click += new RoutedEventHandler(btnAnimeTitles_Click); - btnAnimeTags.Click += new RoutedEventHandler(btnAnimeTags_Click); - btnCustomTags.Click += new RoutedEventHandler(btnCustomTags_Click); - btnAddCustomTag.Click += new RoutedEventHandler(btnAddCustomTag_Click); - btnManageTags.Click += new RoutedEventHandler(btnManageTags_Click); + btnAnimeTitles.Click += btnAnimeTitles_Click; + btnAnimeTags.Click += btnAnimeTags_Click; + btnCustomTags.Click += btnCustomTags_Click; + btnAddCustomTag.Click += btnAddCustomTag_Click; + btnManageTags.Click += btnManageTags_Click; btnPlaylistAdd.ContextMenu = playlistMenu; - btnPlaylistAdd.Click += new RoutedEventHandler(btnPlaylistAdd_Click); + btnPlaylistAdd.Click += btnPlaylistAdd_Click; + + btnRandomEpisode.Click += btnRandomEpisode_Click; - btnRandomEpisode.Click += new RoutedEventHandler(btnRandomEpisode_Click); + chkSerNameOverride.Click += chkSerNameOverride_Click; + btnSelectOverrideName.Click += btnSelectOverrideName_Click; - chkSerNameOverride.Click += new RoutedEventHandler(chkSerNameOverride_Click); - btnSelectOverrideName.Click += new RoutedEventHandler(btnSelectOverrideName_Click); + MainWindow.videoHandler.VideoWatchedEvent += videoHandler_VideoWatchedEvent; - MainWindow.videoHandler.VideoWatchedEvent += new VideoPlayers.VideoHandler.VideoWatchedEventHandler(videoHandler_VideoWatchedEvent); + Unloaded += (sender, e) => MainWindow.videoHandler.VideoWatchedEvent -= videoHandler_VideoWatchedEvent; SetSeriesWidgetOrder(); @@ -237,7 +237,7 @@ private void AnimeSeries_PreviewMouseWheel(object sender, MouseWheelEventArgs e) catch { } } - void videoHandler_VideoWatchedEvent(VideoPlayers.VideoWatchedEventArgs ev) + void videoHandler_VideoWatchedEvent(VideoWatchedEventArgs ev) { if (MainWindow.CurrentMainTabIndex == (int) MainWindow.TAB_MAIN.Collection || MainWindow.CurrentMainTabIndex == (int) MainWindow.TAB_MAIN.Pinned) ShowNextEpisode(); @@ -328,15 +328,15 @@ void btnPlaylistAdd_Click(object sender, RoutedEventArgs e) playlistMenu.Items.Clear(); MenuItem itemSeries = new MenuItem(); - itemSeries.Header = Shoko.Commons.Properties.Resources.Anime_AddSeries; - itemSeries.Click += new RoutedEventHandler(playlistMenuItem_Click); + itemSeries.Header = Commons.Properties.Resources.Anime_AddSeries; + itemSeries.Click += playlistMenuItem_Click; playlistMenu.Items.Add(itemSeries); Separator sep = new Separator(); MenuItem itemSeriesNew = new MenuItem(); - itemSeriesNew.Header = Shoko.Commons.Properties.Resources.Anime_NewPlaylists; - itemSeriesNew.Click += new RoutedEventHandler(playlistMenuItem_Click); + itemSeriesNew.Header = Commons.Properties.Resources.Anime_NewPlaylists; + itemSeriesNew.Click += playlistMenuItem_Click; cmd = new PlaylistMenuCommand(PlaylistItemType.Series, -1); // new playlist itemSeriesNew.CommandParameter = cmd; itemSeries.Items.Add(itemSeriesNew); @@ -346,21 +346,21 @@ void btnPlaylistAdd_Click(object sender, RoutedEventArgs e) { MenuItem itemSeriesPL = new MenuItem(); itemSeriesPL.Header = contract.PlaylistName; - itemSeriesPL.Click += new RoutedEventHandler(playlistMenuItem_Click); + itemSeriesPL.Click += playlistMenuItem_Click; cmd = new PlaylistMenuCommand(PlaylistItemType.Series, contract.PlaylistID); itemSeriesPL.CommandParameter = cmd; itemSeries.Items.Add(itemSeriesPL); } MenuItem itemAllEpisodes = new MenuItem(); - itemAllEpisodes.Header = Shoko.Commons.Properties.Resources.Anime_AddAllEpisodes; + itemAllEpisodes.Header = Commons.Properties.Resources.Anime_AddAllEpisodes; playlistMenu.Items.Add(itemAllEpisodes); Separator sep2 = new Separator(); MenuItem itemAllEpisodesNew = new MenuItem(); - itemAllEpisodesNew.Header = Shoko.Commons.Properties.Resources.Anime_NewPlaylists; - itemAllEpisodesNew.Click += new RoutedEventHandler(playlistMenuItem_Click); + itemAllEpisodesNew.Header = Commons.Properties.Resources.Anime_NewPlaylists; + itemAllEpisodesNew.Click += playlistMenuItem_Click; cmd = new PlaylistMenuCommand(PlaylistItemType.AllEpisodes, -1); // new playlist itemAllEpisodesNew.CommandParameter = cmd; itemAllEpisodes.Items.Add(itemAllEpisodesNew); @@ -370,7 +370,7 @@ void btnPlaylistAdd_Click(object sender, RoutedEventArgs e) { MenuItem itemSeriesPL = new MenuItem(); itemSeriesPL.Header = contract.PlaylistName; - itemSeriesPL.Click += new RoutedEventHandler(playlistMenuItem_Click); + itemSeriesPL.Click += playlistMenuItem_Click; cmd = new PlaylistMenuCommand(PlaylistItemType.AllEpisodes, contract.PlaylistID); itemSeriesPL.CommandParameter = cmd; itemAllEpisodes.Items.Add(itemSeriesPL); @@ -378,14 +378,14 @@ void btnPlaylistAdd_Click(object sender, RoutedEventArgs e) MenuItem itemUnwatchedEpisodes = new MenuItem(); - itemUnwatchedEpisodes.Header = Shoko.Commons.Properties.Resources.Anime_AddUnwatched; + itemUnwatchedEpisodes.Header = Commons.Properties.Resources.Anime_AddUnwatched; playlistMenu.Items.Add(itemUnwatchedEpisodes); Separator sep3 = new Separator(); MenuItem itemUnwatchedEpisodesNew = new MenuItem(); - itemUnwatchedEpisodesNew.Header = Shoko.Commons.Properties.Resources.Anime_NewPlaylists; - itemUnwatchedEpisodesNew.Click += new RoutedEventHandler(playlistMenuItem_Click); + itemUnwatchedEpisodesNew.Header = Commons.Properties.Resources.Anime_NewPlaylists; + itemUnwatchedEpisodesNew.Click += playlistMenuItem_Click; cmd = new PlaylistMenuCommand(PlaylistItemType.UnwatchedEpisodes, -1); // new playlist itemUnwatchedEpisodesNew.CommandParameter = cmd; itemUnwatchedEpisodes.Items.Add(itemUnwatchedEpisodesNew); @@ -395,7 +395,7 @@ void btnPlaylistAdd_Click(object sender, RoutedEventArgs e) { MenuItem itemSeriesPL = new MenuItem(); itemSeriesPL.Header = contract.PlaylistName; - itemSeriesPL.Click += new RoutedEventHandler(playlistMenuItem_Click); + itemSeriesPL.Click += playlistMenuItem_Click; cmd = new PlaylistMenuCommand(PlaylistItemType.UnwatchedEpisodes, contract.PlaylistID); itemSeriesPL.CommandParameter = cmd; itemUnwatchedEpisodes.Items.Add(itemSeriesPL); @@ -425,7 +425,7 @@ void playlistMenuItem_Click(object sender, RoutedEventArgs e) if (item != null && item.CommandParameter != null) { PlaylistMenuCommand cmd = item.CommandParameter as PlaylistMenuCommand; - Debug.Write(Shoko.Commons.Properties.Resources.Anime_PlaylistMenu + " " + cmd.ToString() + Environment.NewLine); + Debug.Write(Commons.Properties.Resources.Anime_PlaylistMenu + " " + cmd + Environment.NewLine); VM_AnimeSeries_User ser = DataContext as VM_AnimeSeries_User; if (ser == null) return; @@ -442,7 +442,7 @@ void playlistMenuItem_Click(object sender, RoutedEventArgs e) pl = (VM_Playlist)VM_ShokoServer.Instance.ShokoServices.GetPlaylist(cmd.PlaylistID); if (pl == null) { - MessageBox.Show(Shoko.Commons.Properties.Resources.Anime_PlaylistMissing, Shoko.Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + MessageBox.Show(Commons.Properties.Resources.Anime_PlaylistMissing, Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } } @@ -530,8 +530,8 @@ void btnEditSeriesFinish_Click(object sender, RoutedEventArgs e) ser.Save(); // prompt to change parent group name - MessageBoxResult res = MessageBox.Show(Shoko.Commons.Properties.Resources.Anime_RenameParent, - Shoko.Commons.Properties.Resources.Confirm, MessageBoxButton.YesNo, MessageBoxImage.Question); + MessageBoxResult res = MessageBox.Show(Commons.Properties.Resources.Anime_RenameParent, + Commons.Properties.Resources.Confirm, MessageBoxButton.YesNo, MessageBoxImage.Question); if (res == MessageBoxResult.Yes) { VM_AnimeGroup_User thisGrp = VM_MainListHelper.Instance.AllGroupsDictionary[ser.AnimeGroupID]; @@ -759,7 +759,7 @@ private void EnableDisableImage(bool enabled, object img) if (res.Length > 0) { - MessageBox.Show(res, Shoko.Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + MessageBox.Show(res, Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); } else { @@ -808,7 +808,7 @@ private void SetDefaultImage(bool isDefault, object img, bool refreshData) Cursor = Cursors.Wait; string res = ""; - string disabledMessage = Shoko.Commons.Properties.Resources.Anime_DisabledImage; + string disabledMessage = Commons.Properties.Resources.Anime_DisabledImage; if (img.GetType() == typeof(VM_PosterContainer)) { @@ -816,7 +816,7 @@ private void SetDefaultImage(bool isDefault, object img, bool refreshData) if (isDefault && !poster.IsImageEnabled) { - MessageBox.Show(disabledMessage, Shoko.Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + MessageBox.Show(disabledMessage, Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } @@ -859,7 +859,7 @@ private void SetDefaultImage(bool isDefault, object img, bool refreshData) if (isDefault && !fanart.IsImageEnabled) { - MessageBox.Show(disabledMessage, Shoko.Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + MessageBox.Show(disabledMessage, Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } @@ -898,7 +898,7 @@ private void SetDefaultImage(bool isDefault, object img, bool refreshData) if (isDefault && !banner.IsImageEnabled) { - MessageBox.Show(disabledMessage, Shoko.Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + MessageBox.Show(disabledMessage, Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } @@ -911,7 +911,7 @@ private void SetDefaultImage(bool isDefault, object img, bool refreshData) if (res.Length > 0) { - MessageBox.Show(res, Shoko.Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + MessageBox.Show(res, Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); } else { @@ -1098,7 +1098,6 @@ void btnAddCustomTag_Click(object sender, RoutedEventArgs e) if (!string.IsNullOrEmpty(resp.ErrorMessage)) { Utils.ShowErrorMessage(resp.ErrorMessage); - return; } else { @@ -1137,7 +1136,7 @@ private void CommandBinding_DeleteCustomTag(object sender, ExecutedRoutedEventAr if (res.Length > 0) { - MessageBox.Show(res, Shoko.Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + MessageBox.Show(res, Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); } else { @@ -1239,9 +1238,9 @@ private void LoadSeries() } cboVoteType.Items.Clear(); - cboVoteType.Items.Add(Shoko.Commons.Properties.Resources.VoteTypeAnimeTemporary); + cboVoteType.Items.Add(Commons.Properties.Resources.VoteTypeAnimeTemporary); if (ser.AniDBAnime.AniDBAnime.FinishedAiring) - cboVoteType.Items.Add(Shoko.Commons.Properties.Resources.VoteTypeAnimePermanent); + cboVoteType.Items.Add(Commons.Properties.Resources.VoteTypeAnimePermanent); if (ser.AniDBAnime.AniDBAnime.FinishedAiring && ser.AllFilesWatched) cboVoteType.SelectedIndex = 1; @@ -1324,8 +1323,8 @@ void cRating_OnRatingValueChangedEvent(RatingValueEventArgs ev) decimal rating = (decimal)ev.RatingValue; int voteType = 1; - if (cboVoteType.SelectedItem.ToString() == Shoko.Commons.Properties.Resources.VoteTypeAnimeTemporary) voteType = 2; - if (cboVoteType.SelectedItem.ToString() == Shoko.Commons.Properties.Resources.VoteTypeAnimePermanent) voteType = 1; + if (cboVoteType.SelectedItem.ToString() == Commons.Properties.Resources.VoteTypeAnimeTemporary) voteType = 2; + if (cboVoteType.SelectedItem.ToString() == Commons.Properties.Resources.VoteTypeAnimePermanent) voteType = 1; VM_ShokoServer.Instance.VoteAnime(ser.AniDB_ID, rating, voteType); @@ -1377,7 +1376,7 @@ private void CommandBinding_ToggleWatchedStatus(object sender, ExecutedRoutedEve newStatus, VM_ShokoServer.Instance.CurrentUser.JMMUserID); if (!string.IsNullOrEmpty(response.ErrorMessage)) { - MessageBox.Show(response.ErrorMessage, Shoko.Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); + MessageBox.Show(response.ErrorMessage, Commons.Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error); return; } @@ -1388,7 +1387,7 @@ private void CommandBinding_ToggleWatchedStatus(object sender, ExecutedRoutedEve ShowNextEpisode(); - if (newStatus == true && serTemp != null) + if (newStatus && serTemp != null) { Utils.PromptToRateSeries(serTemp, parentWindow); } diff --git a/Shoko.Desktop/ViewModel/Server/VM_AniDB_Anime.cs b/Shoko.Desktop/ViewModel/Server/VM_AniDB_Anime.cs index 7a9fae34..74a3bfc4 100644 --- a/Shoko.Desktop/ViewModel/Server/VM_AniDB_Anime.cs +++ b/Shoko.Desktop/ViewModel/Server/VM_AniDB_Anime.cs @@ -36,7 +36,7 @@ public string DescriptionFormatted { if (string.IsNullOrEmpty(Description)) return Shoko.Commons.Properties.Resources.Recommendation_NoOverview; - return Description; + return string.Intern(Description); } } diff --git a/Shoko.Desktop/ViewModel/Server/VM_AniDB_AnimeCrossRefs.cs b/Shoko.Desktop/ViewModel/Server/VM_AniDB_AnimeCrossRefs.cs index 665d1e01..60c55f2a 100644 --- a/Shoko.Desktop/ViewModel/Server/VM_AniDB_AnimeCrossRefs.cs +++ b/Shoko.Desktop/ViewModel/Server/VM_AniDB_AnimeCrossRefs.cs @@ -22,7 +22,7 @@ public class VM_AniDB_AnimeCrossRefs : CL_AniDB_AnimeCrossRefs, INotifyPropertyC private VM_AniDB_Anime anime; public new int AnimeID { - get { return base.AnimeID; } + get => base.AnimeID; set { base.AnimeID = value; @@ -45,14 +45,14 @@ public void NotifyPropertyChanged(string propname) #region TvDB [ScriptIgnore, JsonIgnore, XmlIgnore] - public bool TvDBCrossRefExists => !(Obs_CrossRef_AniDB_TvDB.Count == 0); + public bool TvDBCrossRefExists => Obs_CrossRef_AniDB_TvDB.Count != 0; [ScriptIgnore, JsonIgnore, XmlIgnore] - public bool TvDBCrossRefMissing => (Obs_CrossRef_AniDB_TvDB.Count == 0); + public bool TvDBCrossRefMissing => Obs_CrossRef_AniDB_TvDB.Count == 0; public new List TvDBSeries { - get { return base.TvDBSeries.CastList(); } + get => base.TvDBSeries.CastList(); set { this.SetField(()=>base.TvDBSeries, (r)=>base.TvDBSeries=r, value.CastList(), () => TvDBSeries, () => TvDBCrossRefExists, () => TvDBCrossRefMissing); @@ -85,12 +85,12 @@ public ObservableCollectionEx Obs_CrossRef_AniDB_TvDB public new List TvDBEpisodes { - get { return base.TvDBEpisodes.CastList(); } + get => base.TvDBEpisodes.CastList(); set { this.SetField(()=>base.TvDBEpisodes, (r)=>base.TvDBEpisodes=r, value.CastList(),()=>TvDBEpisodes); } } public new List TvDBImageFanarts { - get { return base.TvDBImageFanarts.CastList(); } + get => base.TvDBImageFanarts.CastList(); set { foreach (VM_TvDB_ImageFanart contract in value) @@ -104,7 +104,7 @@ public new List TvDBImageFanarts } public new List TvDBImagePosters { - get { return base.TvDBImagePosters.CastList(); } + get => base.TvDBImagePosters.CastList(); set { foreach (VM_TvDB_ImagePoster contract in value) @@ -118,7 +118,7 @@ public new List TvDBImagePosters } public new List TvDBImageWideBanners { - get { return base.TvDBImageWideBanners.CastList(); } + get => base.TvDBImageWideBanners.CastList(); set { foreach (VM_TvDB_ImageWideBanner contract in value) @@ -143,7 +143,7 @@ public new List TvDBImageWideBanners public new VM_MovieDB_Movie MovieDBMovie { - get { return (VM_MovieDB_Movie)base.MovieDBMovie; } + get => (VM_MovieDB_Movie)base.MovieDBMovie; set { this.SetField(()=>base.MovieDBMovie, (r)=>base.MovieDBMovie=r, value, ()=>MovieDBMovie, () => MovieDBCrossRefExists, () => MovieDBCrossRefMissing); @@ -152,7 +152,7 @@ public new VM_MovieDB_Movie MovieDBMovie public new CrossRef_AniDB_Other CrossRef_AniDB_MovieDB { - get { return base.CrossRef_AniDB_MovieDB; } + get => base.CrossRef_AniDB_MovieDB; set { this.SetField(()=>base.CrossRef_AniDB_MovieDB,(r)=> base.CrossRef_AniDB_MovieDB = r, value, () => CrossRef_AniDB_MovieDB, () => MovieDBCrossRefExists, ()=>MovieDBCrossRefMissing); @@ -161,7 +161,7 @@ public new CrossRef_AniDB_Other CrossRef_AniDB_MovieDB public new List MovieDBFanarts { - get { return base.MovieDBFanarts.CastList(); } + get => base.MovieDBFanarts.CastList(); set { foreach (VM_MovieDB_Fanart contract in value) @@ -175,7 +175,7 @@ public new List MovieDBFanarts } public new List MovieDBPosters { - get { return base.MovieDBPosters.CastList(); } + get => base.MovieDBPosters.CastList(); set { foreach (VM_MovieDB_Poster contract in value) @@ -196,7 +196,7 @@ public new List MovieDBPosters [ScriptIgnore, JsonIgnore, XmlIgnore] public List AllPosters { - get { return allPosters; } + get => allPosters; set { this.SetField(()=>allPosters, value); @@ -207,7 +207,7 @@ public List AllPosters [ScriptIgnore, JsonIgnore, XmlIgnore] public List AllFanarts { - get { return allFanarts; } + get => allFanarts; set { this.SetField(()=>allFanarts, value); @@ -222,7 +222,7 @@ public List AllFanarts public new List TraktShows { - get { return base.TraktShows.CastList(); } + get => base.TraktShows.CastList(); set { this.SetField(()=>base.TraktShows,(r)=>base.TraktShows=r, value.CastList(), ()=>TraktShows, () => TraktCrossRefExists, () => TraktCrossRefMissing); @@ -231,7 +231,7 @@ public new List TraktShows public new List TraktImageFanarts { - get { return base.TraktImageFanarts.CastList(); } + get => base.TraktImageFanarts.CastList(); set { foreach (VM_Trakt_ImageFanart contract in value) @@ -246,7 +246,7 @@ public new List TraktImageFanarts public new List TraktImagePosters { - get { return base.TraktImagePosters.CastList(); } + get => base.TraktImagePosters.CastList(); set { foreach (VM_Trakt_ImagePoster contract in value) diff --git a/Shoko.Desktop/ViewModel/Server/VM_AniDB_AnimeDetailed.cs b/Shoko.Desktop/ViewModel/Server/VM_AniDB_AnimeDetailed.cs index ba07e5e0..a31d3bd4 100644 --- a/Shoko.Desktop/ViewModel/Server/VM_AniDB_AnimeDetailed.cs +++ b/Shoko.Desktop/ViewModel/Server/VM_AniDB_AnimeDetailed.cs @@ -45,14 +45,14 @@ public new List AnimeTitles } } - public new List Tags + public new List Tags { - get { return base.Tags; } - set { base.Tags = value.OrderByDescending(a => a.Weight).ToList(); } + get { return base.Tags.CastList(); } + set { base.Tags = value.OrderByDescending(a => a.Weight).ToList().CastList(); } } [ScriptIgnore, JsonIgnore, XmlIgnore] - public List TagsSummary => Tags.Take(5).ToList(); + public List TagsSummary => Tags.Take(5).ToList(); public new List CustomTags { @@ -143,10 +143,10 @@ public void Populate(VM_AniDB_AnimeDetailed contract) { AniDBAnime = contract.AniDBAnime; UserVote = contract.UserVote; - Stat_AllVideoQuality =contract.Stat_AllVideoQuality; - Stat_AllVideoQuality_Episodes = contract.Stat_AllVideoQuality_Episodes; - Stat_AudioLanguages = contract.Stat_AudioLanguages; - Stat_SubtitleLanguages = contract.Stat_SubtitleLanguages; + Stat_AllVideoQuality =contract.Stat_AllVideoQuality; + Stat_AllVideoQuality_Episodes = contract.Stat_AllVideoQuality_Episodes; + Stat_AudioLanguages = contract.Stat_AudioLanguages; + Stat_SubtitleLanguages = contract.Stat_SubtitleLanguages; Tags = contract.Tags; CustomTags = contract.CustomTags; AnimeTitles = contract.AnimeTitles; diff --git a/Shoko.Desktop/ViewModel/Server/VM_AniDB_Character.cs b/Shoko.Desktop/ViewModel/Server/VM_AniDB_Character.cs index 14cbd42f..eccb1091 100644 --- a/Shoko.Desktop/ViewModel/Server/VM_AniDB_Character.cs +++ b/Shoko.Desktop/ViewModel/Server/VM_AniDB_Character.cs @@ -1,4 +1,5 @@ -using System.ComponentModel; +using System; +using System.ComponentModel; using System.IO; using System.Web.Script.Serialization; using System.Xml.Serialization; @@ -32,17 +33,17 @@ public new VM_AniDB_Seiyuu Seiyuu [ScriptIgnore, JsonIgnore, XmlIgnore] - public string ImagePathPlain => Path.Combine(Utils.GetAniDBCharacterImagePath(CharID), PicName); + public string ImagePathPlain => string.Intern(Path.Combine(Utils.GetAniDBCharacterImagePath(CharID), PicName)); [ScriptIgnore, JsonIgnore, XmlIgnore] - public string CharNameShort => CharName.Length <= 25 ? CharName : CharName.Substring(0, 24) + "..."; + public string CharNameShort => CharName.Length <= 25 ? CharName : string.Intern(CharName.Substring(0, 24) + "..."); [ScriptIgnore, JsonIgnore, XmlIgnore] public string ImagePath { get { - string fileName = Path.Combine(Utils.GetAniDBCharacterImagePath(CharID), PicName); + string fileName = string.Intern(Path.Combine(Utils.GetAniDBCharacterImagePath(CharID), PicName)); if (!File.Exists(fileName)) { @@ -50,13 +51,47 @@ public string ImagePath MainWindow.imageHelper.DownloadImage(req); if (File.Exists(fileName)) return fileName; - string packUriBlank = $"pack://application:,,,/{System.Reflection.Assembly.GetExecutingAssembly().GetName().Name};component/Images/blankposter.png"; + string packUriBlank = string.Intern($"pack://application:,,,/{System.Reflection.Assembly.GetExecutingAssembly().GetName().Name};component/Images/blankposter.png"); return packUriBlank; } return fileName; } } + public new string PicName + { + get => base.PicName == null ? null : string.Intern(base.PicName); + set => base.PicName = value == null ? null : string.Intern(value); + } + + public new string CreatorListRaw + { + get => base.CreatorListRaw == null ? null : string.Intern(base.CreatorListRaw); + set => base.CreatorListRaw = value == null ? null : string.Intern(value); + } + + public new string CharName + { + get => base.CharName == null ? null : string.Intern(base.CharName); + set => base.CharName = value == null ? null : string.Intern(value); + } + public new string CharKanjiName + { + get => base.CharKanjiName == null ? null : string.Intern(base.CharKanjiName); + set => base.CharKanjiName = value == null ? null : string.Intern(value); + } + + public new string CharDescription + { + get => base.CharDescription == null ? null : string.Intern(base.CharDescription); + set => base.CharDescription = value == null ? null : string.Intern(value); + } + + public new string CharType + { + get => base.CharType == null ? null : string.Intern(base.CharType); + set => base.CharType = value == null ? null : string.Intern(value); + } } -} +} \ No newline at end of file diff --git a/Shoko.Desktop/ViewModel/Server/VM_AnimeTag.cs b/Shoko.Desktop/ViewModel/Server/VM_AnimeTag.cs new file mode 100644 index 00000000..2868578c --- /dev/null +++ b/Shoko.Desktop/ViewModel/Server/VM_AnimeTag.cs @@ -0,0 +1,19 @@ +using Shoko.Models.Client; + +namespace Shoko.Desktop.ViewModel.Server +{ + public class VM_AnimeTag : CL_AnimeTag + { + public new string TagName + { + get => base.TagName == null ? null : string.Intern(base.TagName); + set => base.TagName = value == null ? null : string.Intern(value); + } + + public new string TagDescription + { + get => base.TagDescription == null ? null : string.Intern(base.TagDescription); + set => base.TagDescription = value == null ? null : string.Intern(value); + } + } +} \ No newline at end of file diff --git a/Shoko.Desktop/ViewModel/Server/VM_AnimeTitle.cs b/Shoko.Desktop/ViewModel/Server/VM_AnimeTitle.cs index 2089eab0..3dc679b4 100644 --- a/Shoko.Desktop/ViewModel/Server/VM_AnimeTitle.cs +++ b/Shoko.Desktop/ViewModel/Server/VM_AnimeTitle.cs @@ -10,8 +10,26 @@ namespace Shoko.Desktop.ViewModel.Server public class VM_AnimeTitle : CL_AnimeTitle { [ScriptIgnore, JsonIgnore, XmlIgnore] - public string FlagImage => this.GetFlagImage(); + public string FlagImage => string.Intern(this.GetFlagImage()); [ScriptIgnore, JsonIgnore, XmlIgnore] - public string LanguageDescription => this.GetLanguageDescription(); + public string LanguageDescription => string.Intern(this.GetLanguageDescription()); + + public new string TitleType + { + get => base.TitleType == null ? null : string.Intern(base.TitleType); + set => base.TitleType = value == null ? null : string.Intern(value); + } + + public new string Language + { + get => base.Language == null ? null : string.Intern(base.Language); + set => base.Language = value == null ? null : string.Intern(value); + } + + public new string Title + { + get => base.Title == null ? null : string.Intern(base.Title); + set => base.Title = value == null ? null : string.Intern(value); + } } } diff --git a/Shoko.Desktop/ViewModel/Server/VM_TvDB_Episode.cs b/Shoko.Desktop/ViewModel/Server/VM_TvDB_Episode.cs index 086146db..a0298b56 100644 --- a/Shoko.Desktop/ViewModel/Server/VM_TvDB_Episode.cs +++ b/Shoko.Desktop/ViewModel/Server/VM_TvDB_Episode.cs @@ -13,12 +13,30 @@ namespace Shoko.Desktop.ViewModel.Server { public class VM_TvDB_Episode : TvDB_Episode { + public new string EpisodeName + { + get => base.EpisodeName == null ? null : string.Intern(base.EpisodeName); + set => base.EpisodeName = value == null ? null : string.Intern(value); + } + + public new string Overview + { + get => base.Overview == null ? null : string.Intern(base.Overview); + set => base.Overview = value == null ? null : string.Intern(value); + } + + public new string Filename + { + get => base.Filename == null ? null : string.Intern(base.Filename); + set => base.Filename = value == null ? null : string.Intern(value); + } + [ScriptIgnore, JsonIgnore, XmlIgnore] public string ImagePath { get { - if (string.IsNullOrEmpty(Filename)) return @"/Images/EpisodeThumb_NotFound.png"; + if (string.IsNullOrEmpty(Filename)) return string.Intern("/Images/EpisodeThumb_NotFound.png"); if (File.Exists(FullImagePath)) return FullImagePath; @@ -27,7 +45,7 @@ public string ImagePath } [ScriptIgnore, JsonIgnore, XmlIgnore] - public string FullImagePathPlain => string.IsNullOrEmpty(Filename) ? "" : Path.Combine(Utils.GetTvDBImagePath(), Filename.Replace("/", @"\")); + public string FullImagePathPlain => string.IsNullOrEmpty(Filename) ? string.Intern("") : string.Intern(Path.Combine(Utils.GetTvDBImagePath(), Filename.Replace("/", @"\"))); [ScriptIgnore, JsonIgnore, XmlIgnore] public string FullImagePath @@ -48,6 +66,6 @@ public string FullImagePath } [ScriptIgnore, JsonIgnore, XmlIgnore] - public string OnlineImagePath => string.IsNullOrEmpty(Filename) ? "" : string.Format(Models.Constants.URLS.TvDB_Images, Filename); + public string OnlineImagePath => string.IsNullOrEmpty(Filename) ? string.Intern("") : string.Intern(string.Format(Models.Constants.URLS.TvDB_Images, Filename)); } } diff --git a/Shoko.Desktop/ViewModel/Server/VM_TvDB_ImageFanart.cs b/Shoko.Desktop/ViewModel/Server/VM_TvDB_ImageFanart.cs index 5b5c354e..b2d96648 100644 --- a/Shoko.Desktop/ViewModel/Server/VM_TvDB_ImageFanart.cs +++ b/Shoko.Desktop/ViewModel/Server/VM_TvDB_ImageFanart.cs @@ -24,7 +24,7 @@ public void NotifyPropertyChanged(string propname) } [ScriptIgnore, JsonIgnore, XmlIgnore] - public string FullImagePathPlain => Path.Combine(Utils.GetTvDBImagePath(), BannerPath.Replace("/", @"\")); + public string FullImagePathPlain => string.Intern(Path.Combine(Utils.GetTvDBImagePath(), BannerPath.Replace("/", @"\"))); [ScriptIgnore, JsonIgnore, XmlIgnore] public string FullImagePath @@ -43,7 +43,7 @@ public string FullImagePath } [ScriptIgnore, JsonIgnore, XmlIgnore] - public string FullThumbnailPathPlain => Path.Combine(Utils.GetTvDBImagePath(), ThumbnailPath.Replace("/", @"\")); + public string FullThumbnailPathPlain => string.Intern(Path.Combine(Utils.GetTvDBImagePath(), ThumbnailPath.Replace("/", @"\"))); [ScriptIgnore, JsonIgnore, XmlIgnore] public string FullThumbnailPath @@ -82,6 +82,46 @@ public bool IsImageDefault set { this.SetField(()=>isImageDefault,value); } } + public new string BannerPath + { + get => base.BannerPath == null ? null : string.Intern(base.BannerPath); + set => base.BannerPath = value == null ? null : string.Intern(value); + } + + public new string BannerType + { + get => base.BannerType == null ? null : string.Intern(base.BannerType); + set => base.BannerType = value == null ? null : string.Intern(value); + } + public new string BannerType2 + { + get => base.BannerType2 == null ? null : string.Intern(base.BannerType2); + set => base.BannerType2 = value == null ? null : string.Intern(value); + } + + public new string Colors + { + get => base.Colors == null ? null : string.Intern(base.Colors); + set => base.Colors = value == null ? null : string.Intern(value); + } + + public new string Language + { + get => base.Language == null ? null : string.Intern(base.Language); + set => base.Language = value == null ? null : string.Intern(value); + } + + public new string ThumbnailPath + { + get => base.ThumbnailPath == null ? null : string.Intern(base.ThumbnailPath); + set => base.ThumbnailPath = value == null ? null : string.Intern(value); + } + + public new string VignettePath + { + get => base.VignettePath == null ? null : string.Intern(base.VignettePath); + set => base.VignettePath = value == null ? null : string.Intern(value); + } } } diff --git a/Shoko.Desktop/ViewModel/Server/VM_TvDB_ImagePoster.cs b/Shoko.Desktop/ViewModel/Server/VM_TvDB_ImagePoster.cs index b429d89c..8aee6542 100644 --- a/Shoko.Desktop/ViewModel/Server/VM_TvDB_ImagePoster.cs +++ b/Shoko.Desktop/ViewModel/Server/VM_TvDB_ImagePoster.cs @@ -1,4 +1,5 @@ -using System.ComponentModel; +using System; +using System.ComponentModel; using System.IO; using System.Web.Script.Serialization; using System.Xml.Serialization; @@ -30,7 +31,7 @@ public string FullImagePathPlain get { if (string.IsNullOrEmpty(BannerPath)) return ""; - return Path.Combine(Utils.GetTvDBImagePath(), BannerPath.Replace("/", @"\")); + return string.Intern(Path.Combine(Utils.GetTvDBImagePath(), BannerPath.Replace("/", @"\"))); } } @@ -71,5 +72,29 @@ public bool IsImageDefault set { this.SetField(()=>isImageDefault,value); } } + public new string BannerPath + { + get => base.BannerPath == null ? null : string.Intern(base.BannerPath); + set => base.BannerPath = value == null ? null : string.Intern(value); + } + + public new string BannerType + { + get => base.BannerType == null ? null : string.Intern(base.BannerType); + set => base.BannerType = value == null ? null : string.Intern(value); + } + + public new string BannerType2 + { + get => base.BannerType2 == null ? null : string.Intern(base.BannerType2); + set => base.BannerType2 = value == null ? null : string.Intern(value); + } + + public new string Language + { + get => base.Language == null ? null : string.Intern(base.Language); + set => base.Language = value == null ? null : string.Intern(value); + } + } } diff --git a/Shoko.Desktop/ViewModel/Server/VM_TvDB_ImageWideBanner.cs b/Shoko.Desktop/ViewModel/Server/VM_TvDB_ImageWideBanner.cs index 1fcc6c61..87c65dca 100644 --- a/Shoko.Desktop/ViewModel/Server/VM_TvDB_ImageWideBanner.cs +++ b/Shoko.Desktop/ViewModel/Server/VM_TvDB_ImageWideBanner.cs @@ -25,7 +25,7 @@ public void NotifyPropertyChanged(string propname) } [ScriptIgnore, JsonIgnore, XmlIgnore] - public string FullImagePathPlain => Path.Combine(Utils.GetTvDBImagePath(), BannerPath.Replace("/", @"\")); + public string FullImagePathPlain => string.Intern(Path.Combine(Utils.GetTvDBImagePath(), BannerPath.Replace("/", @"\"))); [ScriptIgnore, JsonIgnore, XmlIgnore] public string FullImagePath @@ -64,5 +64,29 @@ public bool IsImageDefault set { this.SetField(()=>isImageDefault,value); } } + public new string BannerPath + { + get => base.BannerPath == null ? null : string.Intern(base.BannerPath); + set => base.BannerPath = value == null ? null : string.Intern(value); + } + + public new string BannerType + { + get => base.BannerType == null ? null : string.Intern(base.BannerType); + set => base.BannerType = value == null ? null : string.Intern(value); + } + + public new string BannerType2 + { + get => base.BannerType2 == null ? null : string.Intern(base.BannerType2); + set => base.BannerType2 = value == null ? null : string.Intern(value); + } + + public new string Language + { + get => base.Language == null ? null : string.Intern(base.Language); + set => base.Language = value == null ? null : string.Intern(value); + } + } } diff --git a/Shoko.Desktop/ViewModel/Server/VM_TvDB_Language.cs b/Shoko.Desktop/ViewModel/Server/VM_TvDB_Language.cs index ce9bcfeb..fbe5c0b0 100644 --- a/Shoko.Desktop/ViewModel/Server/VM_TvDB_Language.cs +++ b/Shoko.Desktop/ViewModel/Server/VM_TvDB_Language.cs @@ -1,4 +1,5 @@ -using System.Web.Script.Serialization; +using System; +using System.Web.Script.Serialization; using System.Xml.Serialization; using Newtonsoft.Json; using Shoko.Commons.Extensions; @@ -10,6 +11,6 @@ namespace Shoko.Desktop.ViewModel.Server public class VM_TvDB_Language : TvDB_Language { [ScriptIgnore, JsonIgnore, XmlIgnore] - public string LanguageFlagImage => this.GetLanguageFlagImage(); + public string LanguageFlagImage => string.Intern(this.GetLanguageFlagImage()); } } diff --git a/Shoko.Desktop/ViewModel/VM_ShokoServer.cs b/Shoko.Desktop/ViewModel/VM_ShokoServer.cs index 7960c658..b564b364 100644 --- a/Shoko.Desktop/ViewModel/VM_ShokoServer.cs +++ b/Shoko.Desktop/ViewModel/VM_ShokoServer.cs @@ -143,6 +143,7 @@ public bool SetupClient() mappings.Add(typeof(AniDB_Episode), typeof(VM_AniDB_Episode)); mappings.Add(typeof(AniDB_Recommendation), typeof(VM_AniDB_Recommendation)); mappings.Add(typeof(AniDB_Seiyuu), typeof(VM_AniDB_Seiyuu)); + mappings.Add(typeof(CL_AnimeTag), typeof(VM_AnimeTag)); mappings.Add(typeof(CL_AnimeEpisode_User), typeof(VM_AnimeEpisode_User)); mappings.Add(typeof(CL_AnimeGroup_User), typeof(VM_AnimeGroup_User)); mappings.Add(typeof(CL_AnimeRating), typeof(VM_AnimeRating)); diff --git a/Shoko.Desktop/ViewModel/VM_TvDBDetails.cs b/Shoko.Desktop/ViewModel/VM_TvDBDetails.cs index b5344487..e21844db 100644 --- a/Shoko.Desktop/ViewModel/VM_TvDBDetails.cs +++ b/Shoko.Desktop/ViewModel/VM_TvDBDetails.cs @@ -35,11 +35,9 @@ public VM_TvDBDetails(int tvDBID) // create a dictionary of absolute episode numbers for tvdb episodes // sort by season and episode number // ignore season 0, which is used for specials - List eps = TvDBEpisodes; - int i = 1; - foreach (VM_TvDB_Episode ep in eps) + foreach (VM_TvDB_Episode ep in TvDBEpisodes) { dictTvDBEpisodes[i] = ep; i++; @@ -72,10 +70,9 @@ public VM_TvDBDetails(int tvDBID) dictTvDBSeasons = new Dictionary(); // create a dictionary of season numbers and the first episode for that season - List eps = TvDBEpisodes; int i = 1; int lastSeason = -999; - foreach (VM_TvDB_Episode ep in eps) + foreach (VM_TvDB_Episode ep in TvDBEpisodes) { if (ep.SeasonNumber != lastSeason) dictTvDBSeasons[ep.SeasonNumber] = i; @@ -112,11 +109,9 @@ public VM_TvDBDetails(int tvDBID) dictTvDBSeasonsSpecials = new Dictionary(); // create a dictionary of season numbers and the first episode for that season - - List eps = TvDBEpisodes; int i = 1; int lastSeason = -999; - foreach (VM_TvDB_Episode ep in eps) + foreach (VM_TvDB_Episode ep in TvDBEpisodes) { if (ep.SeasonNumber > 0) continue; diff --git a/Shoko.Desktop/ViewModel/VM_TvDBSummary.cs b/Shoko.Desktop/ViewModel/VM_TvDBSummary.cs index 9f91ab53..7b3f6a35 100644 --- a/Shoko.Desktop/ViewModel/VM_TvDBSummary.cs +++ b/Shoko.Desktop/ViewModel/VM_TvDBSummary.cs @@ -98,10 +98,8 @@ private void PopulateDictTvDBEpisodes() // create a dictionary of absolute episode numbers for tvdb episodes // sort by season and episode number // ignore season 0, which is used for specials - List eps = det.TvDBEpisodes; - int i = 1; - foreach (VM_TvDB_Episode ep in eps) + foreach (VM_TvDB_Episode ep in det.TvDBEpisodes) { dictTvDBEpisodes[i] = ep; i++;