示例#1
0
 public MatroskaTags()
 {
     TagList = new List<Tag>();
       Series = new SeriesTag(this);
       Movie = new MovieTag(this);
       MusicVideo = new MusicVideoTag(this);
 }
示例#2
0
 public MatroskaTags()
 {
     TagList    = new List <Tag>();
     Series     = new SeriesTag(this);
     Movie      = new MovieTag(this);
     MusicVideo = new MusicVideoTag(this);
 }
        private MovieTag CopyMovieInfos(MovieTag movieTag, Movie movie)
        {
            movieTag.Title = movie.Title;
              movieTag.IMDB_ID = movie.ImdbId;
              movieTag.TMDB_ID = movie.Id.ToString();

              MovieCollection collection = movie.Collection;
              movieTag.CollectionTitle = collection != null ? collection.Name : null;

              movieTag.ReleaseDate = movie.ReleaseDate.HasValue ? movie.ReleaseDate.Value.ToString("yyyy-MM-dd") : null;
              movieTag.Overview = movie.Overview;
              movieTag.Tagline = movie.Tagline;

              //todo: implement certification
              //movieTag.Certification = movie.

              movieTag.Genres = movie.Genres.Select(g => g.Name).ToList().AsReadOnly();

              MovieCasts casts = movieDbApi.GetCastCrew(movie.Id);
              if (casts == null)
            return movieTag;

              movieTag.Actors = casts.Cast.Select(p => p.Name).ToList().AsReadOnly();
              movieTag.Directors = casts.Crew.Where(p => p.Job == "Director").Select(p => p.Name).ToList().AsReadOnly();
              movieTag.Writers = casts.Crew.Where(p => p.Job == "Author").Select(p => p.Name).ToList().AsReadOnly();

              return movieTag;
        }
        public MovieTag UpdateTags(MovieTag movieTag)
        {
            if (movieDbApi == null)
            movieDbApi = new MovieDbApiV3(API_KEY, null);

              Movie movie;

              string imdb = movieTag.IMDB_ID;
              if (!string.IsNullOrEmpty(imdb))
              {
            movie = movieDbApi.GetMovie(imdb, App.Config.SelectedTMDBLanguageValue);
            if (movie != null)
              return CopyMovieInfos(movieTag, movie);

            MessageBox.Show("TMDB lookup by IMDB id failed.");
              }

              string name = movieTag.Title;
              if (string.IsNullOrEmpty(imdb) && string.IsNullOrEmpty(name))
              {
            MessageBox.Show("TMDB lookup needs atleast IMDB id or movie title.");
            return movieTag;
              }

              MovieSearchResult searchResult = SearchMovie(name);

              if (searchResult == null)
            return movieTag;

              movie = movieDbApi.GetMovie(searchResult.Id, App.Config.SelectedTMDBLanguageValue);
              if (movie == null)
            return movieTag;

              return CopyMovieInfos(movieTag, movie);
        }
        private MovieTag UpdateTagFromGUI(MovieTag tag)
        {
            // Recommended for identification
              tag.Title = Title.Value;
              tag.IMDB_ID = IMDB_ID.Value;
              tag.TMDB_ID = TMDB_ID.Value;

              // additional collection infos
              tag.CollectionTitle = CollectionTitle.Value;
              tag.CollectionIndex = CollectionIndex.Value;
              tag.CollectionKeywords = CollectionKeywords.Value;
              // additional episode infos
              tag.ReleaseDate = ReleaseDate.Value;
              tag.Overview = Overview.Value;
              tag.Tagline = Tagline.Value;
              tag.Certification = Certification.Value;
              tag.Genres = Genres.Value;
              tag.Actors = Actors.Value;
              tag.Directors = Directors.Value;
              tag.Writers = Writers.Value;
              tag.MovieKeywords = MovieKeywords.Value;

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

              // Recommended for identification
              Title.Value = tag.Title;
              IMDB_ID.Value = tag.IMDB_ID;
              TMDB_ID.Value = tag.TMDB_ID;

              // additional collection infos
              CollectionTitle.Value = tag.CollectionTitle;
              CollectionIndex.Value = tag.CollectionIndex;
              CollectionKeywords.Value = tag.CollectionKeywords;
              // additional episode infos
              ReleaseDate.Value = tag.ReleaseDate;
              Overview.Value = tag.Overview;
              Tagline.Value = tag.Tagline;
              Certification.Value = tag.Certification;
              Genres.Value = tag.Genres;
              Actors.Value = tag.Actors;
              Directors.Value = tag.Directors;
              Writers.Value = tag.Writers;
              MovieKeywords.Value = tag.MovieKeywords;
        }