Exemplo n.º 1
0
        public static void DeleteSeries(MasterSeriesListModel masterSeriesList)
        {
            var series = MasterSeriesNameList.Where(c => c.SeriesName == masterSeriesList.SeriesName).Single();
            TvDBFactory.masterSeriesNameList.Remove(series);

            var s = TvDBFactory.tvDatabase[series.SeriesName];

            foreach (var season in s.Seasons)
            {
                foreach (var episode in season.Value.Episodes)
                {
                    if (!string.IsNullOrEmpty(episode.FilePath.PathAndFilename))
                    {
                        var files =
                            (MasterMediaDBFactory.MasterTvMediaDatabase.Where(
                                f => f == episode.FilePath.PathAndFilename)).ToList();

                        for (int index = 0; index < files.Count; index++)
                        {
                            var f = files[index];
                            MasterMediaDBFactory.MasterTvMediaDatabase.Remove(f);
                        }
                    }
                }
            }

            TvDBFactory.tvDatabase.Remove(series.SeriesName);

            DatabaseIOFactory.DatabaseDirty = true;
        }
Exemplo n.º 2
0
        public static void SetSeriesHide(MasterSeriesListModel series)
        {
            TvDBFactory.HideSeries(series.SeriesName);

            DatabaseIOFactory.DatabaseDirty = true;
        }