Esempio n. 1
0
        protected void ParseProviderLinks(T item, string xml)
        {
            if (ProviderIdParsers.TryFindImdbId(xml, out var imdbId))
            {
                item.SetProviderId(MetadataProvider.Imdb, imdbId.ToString());
            }

            if (item is Movie)
            {
                if (ProviderIdParsers.TryFindTmdbMovieId(xml, out var tmdbId))
                {
                    item.SetProviderId(MetadataProvider.Tmdb, tmdbId.ToString());
                }
            }

            if (item is Series)
            {
                if (ProviderIdParsers.TryFindTmdbSeriesId(xml, out var tmdbId))
                {
                    item.SetProviderId(MetadataProvider.Tmdb, tmdbId.ToString());
                }

                if (ProviderIdParsers.TryFindTvdbId(xml, out var tvdbId))
                {
                    item.SetProviderId(MetadataProvider.Tvdb, tvdbId.ToString());
                }
            }
        }
Esempio n. 2
0
 public void FindTvdbId_Invalid_Success(string text)
 {
     Assert.False(ProviderIdParsers.TryFindTvdbId(text, out _));
 }
Esempio n. 3
0
 public void FindTvdbId_Valid_Success(string text, string expected)
 {
     Assert.True(ProviderIdParsers.TryFindTvdbId(text, out ReadOnlySpan <char> parsedId));
     Assert.Equal(expected, parsedId.ToString());
 }