Esempio n. 1
0
 public MatroskaTags()
 {
     TagList = new List<Tag>();
       Series = new SeriesTag(this);
       Movie = new MovieTag(this);
       MusicVideo = new MusicVideoTag(this);
 }
Esempio n. 2
0
 public MatroskaTags()
 {
     TagList    = new List <Tag>();
     Series     = new SeriesTag(this);
     Movie      = new MovieTag(this);
     MusicVideo = new MusicVideoTag(this);
 }
Esempio n. 3
0
        public SeriesTag UpdateTags(SeriesTag seriesTag)
        {
            if (TVDB == null)
            TVDB = new TvdbHandler(API_KEY);

              string imdb = seriesTag.IMDB_ID;
              string name = seriesTag.SeriesName;
              if (string.IsNullOrEmpty(imdb) && string.IsNullOrEmpty(name))
              {
            MessageBox.Show("TvDb lookup needs atleast IMDB id or series name.");
            return seriesTag;
              }

              int iSeason;
              int iEpisode;
              if (!int.TryParse(seriesTag.SeasonIndex, out iSeason) || !int.TryParse(seriesTag.EpisodeIndexList.FirstOrDefault(), out iEpisode))
              {
            MessageBox.Show("TvDb lookup needs season & episode index.");
            return seriesTag;
              }

              TvdbSearchResult searchResult;

              if (!string.IsNullOrEmpty(imdb))
            searchResult = SearchSeries(imdb, true);
              else
            searchResult = SearchSeries(name);

              if (searchResult == null)
            return seriesTag;

              TvdbSeries series = TVDB.GetFullSeries(searchResult.Id, App.Config.SelectedTvDbLanguage, false);
              if (series == null)
            return seriesTag;

              return CopySeriesInfos(seriesTag, series, iSeason, iEpisode);
        }
Esempio n. 4
0
        private SeriesTag CopySeriesInfos(SeriesTag seriesTag, TvdbSeries series, int seasonIndex, int episodeIndex)
        {
            seriesTag.SeriesName = series.SeriesName;
              seriesTag.IMDB_ID = series.ImdbId;
              seriesTag.TVDB_ID = series.Id.ToString();
              // Do not overwrite the index
              //seriesTag.SeasonIndex
              //seriesTag.EpisodeIndexList

              seriesTag.Network = series.Network;
              seriesTag.Certification = series.ContentRating;
              seriesTag.SeriesFirstAired = series.FirstAired.ToString("yyyy-MM-dd");
              seriesTag.SeriesOverview = series.Overview;
              seriesTag.SeriesGenreList = series.Genre.AsReadOnly();
              seriesTag.SeriesActors = series.Actors.AsReadOnly();

              TvdbEpisode ep =
            series.Episodes.FirstOrDefault(e => e.SeasonNumber == seasonIndex && e.EpisodeNumber == episodeIndex);
              if (ep == null)
            return seriesTag;

              seriesTag.EpisodeFirstAired = ep.FirstAired.ToString("yyyy-MM-dd");
              seriesTag.EpisodeTitle = ep.EpisodeName;
              seriesTag.EpisodeIMDB_ID = ep.ImdbId;
              seriesTag.EpisodeOverview = ep.Overview;
              seriesTag.GuestStars = ep.GuestStars.AsReadOnly();
              seriesTag.Directors = ep.Directors.AsReadOnly();
              seriesTag.Writers = ep.Writer.AsReadOnly();

              return seriesTag;
        }
        private static SeriesTag CopyEpisodeToTag(SeriesTag tag, Episode ep)
        {
            tag.SeriesName = ep.SeriesInfo.Title;
              tag.IMDB_ID = ep.SeriesInfo.IMDB_ID;
              tag.TVDB_ID = ep.SeriesInfo.ID.ToString();
              tag.SeasonIndex = ep.SeasonIndex.ToString();
              tag.EpisodeIndexList = ep.EpisodeIndexList.AsReadOnly();
              tag.EpisodeFirstAired = ep.FirstAired;

              // additional series tags
              tag.SeriesFirstAired = ep.SeriesInfo.FirstAired;
              tag.Network = ep.SeriesInfo.Network;
              tag.Certification = ep.SeriesInfo.Certification;
              tag.SeriesOverview = ep.SeriesInfo.Summary;

              tag.SeriesGenreList = ep.SeriesInfo.Genre.AsReadOnly();
              tag.SeriesActors = ep.SeriesInfo.Actors.AsReadOnly();

              // additional episode tags
              tag.EpisodeTitle = ep.EpisodeName;
              tag.EpisodeIMDB_ID = ep.IMDB_ID;
              tag.EpisodeOverview = ep.Summary;

              tag.GuestStars = ep.GuestStars.AsReadOnly();
              tag.Directors = ep.Directors.AsReadOnly();
              tag.Writers = ep.Writers.AsReadOnly();

              return tag;
        }
        //public Dictionary<string,Episode> GetAllEpisodes()
        //{
        //  string db = DatabasePath;
        //  OpenConnection(db);
        //  Dictionary<string,Episode> episodes = new Dictionary<string, Episode>();
        //  using (var command = new SQLiteCommand(connection))
        //  {
        //    command.CommandText = "SELECT * FROM local_episodes";
        //    using (SQLiteDataReader reader = command.ExecuteReader())
        //    {
        //      while (reader.Read())
        //      {
        //        Episode ep = FillLocalEpisodeInfo(new Episode(), reader);
        //        episodes.Add(ep.Filename,ep);
        //      }
        //      reader.Close();
        //    }
        //  }
        //  foreach (Episode episode in episodes.Values)
        //  {
        //  }
        //  CloseConnection();
        //  return episodes;
        //}
        //public Dictionary<int, Series> GetAllSeries()
        //{
        //  string db = DatabasePath;
        //  OpenConnection(db);
        //  Dictionary<int, Series> series = new Dictionary<int, Series>();
        //  using (var command = new SQLiteCommand(connection))
        //  {
        //    command.CommandText = "SELECT * FROM online_series";
        //    using (SQLiteDataReader reader = command.ExecuteReader())
        //    {
        //      while (reader.Read())
        //      {
        //        Series s = FillSeriesInfo(new Series(), reader);
        //        series.Add(s.ID, s);
        //      }
        //      reader.Close();
        //    }
        //  }
        //  CloseConnection();
        //  return series;
        //}
        public SeriesTag UpdateTags(SeriesTag seriesTag, string filename)
        {
            Episode ep = null;
              try
              {
            MPTVSeriesImporter i = new MPTVSeriesImporter();
            ep = i.GetEpisodeInfo(filename);
              }
              catch (Exception ex)
              {
            MessageBox.Show(ex.Message);
            return seriesTag;
              }

              if (ep == null)
            return seriesTag;

              return CopyEpisodeToTag(seriesTag, ep);
        }
        private SeriesTag UpdateTagFromGUI(SeriesTag tag)
        {
            // Recommended for identification
              tag.SeriesName = seriesTitle.Value;
              tag.IMDB_ID = seriesIMDB.Value;
              tag.TVDB_ID = seriesTVDB.Value;
              tag.SeasonIndex = seasonIndex.Value;
              tag.EpisodeIndexList = episodeIndexList.Value;
              tag.EpisodeFirstAired = episodeAired.Value;

              // additional series infos
              tag.SeriesFirstAired = seriesFirstAired.Value;
              tag.SeriesOverview = seriesSummary.Value;
              tag.SeriesGenreList = seriesGenre.Value;
              tag.SeriesActors = seriesActors.Value;
              tag.Certification = Certification.Value;
              tag.Network = Network.Value;
              tag.SeriesKeywords = seriesKeywords.Value;
              // additional episode infos
              tag.EpisodeIMDB_ID = episodeIMDB.Value;
              tag.EpisodeTitle = episodeTitle.Value;
              tag.EpisodeOverview = episodeSummary.Value;
              tag.GuestStars = GuestStars.Value;
              tag.Directors = Directors.Value;
              tag.Writers = Writers.Value;
              tag.EpisodeKeywords = episodeKeywords.Value;

              return tag;
        }
        private void UpdateGUI(SeriesTag tag = null)
        {
            ClearGUI();
              if (ReferenceEquals(tag, null)) return;

              // Recommended for identification
              seriesTitle.Value = tag.SeriesName;
              seriesIMDB.Value = tag.IMDB_ID;
              seriesTVDB.Value = tag.TVDB_ID;
              seasonIndex.Value = tag.SeasonIndex;
              episodeIndexList.Value = tag.EpisodeIndexList;
              episodeAired.Value = tag.EpisodeFirstAired;

              // additional series infos
              seriesFirstAired.Value = tag.SeriesFirstAired;
              seriesSummary.Value = tag.SeriesOverview;
              seriesGenre.Value = tag.SeriesGenreList;
              seriesActors.Value = tag.SeriesActors;
              Certification.Value = tag.Certification;
              Network.Value = tag.Network;
              seriesKeywords.Value = tag.SeriesKeywords;
              // additional episode infos
              episodeIMDB.Value = tag.EpisodeIMDB_ID;
              episodeTitle.Value = tag.EpisodeTitle;
              episodeSummary.Value = tag.EpisodeOverview;
              GuestStars.Value = tag.GuestStars;
              Directors.Value = tag.Directors;
              Writers.Value = tag.Writers;
              episodeKeywords.Value = tag.EpisodeKeywords;
        }