Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional provider id parsing to file name #6912

Merged
merged 9 commits into from
Dec 15, 2021
Merged
35 changes: 32 additions & 3 deletions Emby.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,40 @@ private static void SetProviderIdFromPath(Series item, string path)
{
var justName = Path.GetFileName(path);

var id = justName.GetAttributeValue("tvdbid");
var tvdbId = justName.GetAttributeValue("tvdbid");
if (!string.IsNullOrEmpty(tvdbId))
{
item.SetProviderId(MetadataProvider.Tvdb, tvdbId);
}

var tvmazeId = justName.GetAttributeValue("tvmazeid");
if (!string.IsNullOrEmpty(tvmazeId))
{
item.SetProviderId(MetadataProvider.TvMaze, tvmazeId);
}

var tmdbId = justName.GetAttributeValue("tmdbid");
if (!string.IsNullOrEmpty(tmdbId))
{
item.SetProviderId(MetadataProvider.Tmdb, tmdbId);
}

var anidbId = justName.GetAttributeValue("anidbid");
if (!string.IsNullOrEmpty(anidbId))
{
item.SetProviderId("AniDB", anidbId);
}

var aniListId = justName.GetAttributeValue("anilistid");
if (!string.IsNullOrEmpty(aniListId))
{
item.SetProviderId("AniList", aniListId);
}

if (!string.IsNullOrEmpty(id))
var aniSearchId = justName.GetAttributeValue("anisearchid");
if (!string.IsNullOrEmpty(aniSearchId))
{
item.SetProviderId(MetadataProvider.Tvdb, id);
item.SetProviderId("AniSearch", aniSearchId);
}
}
}
Expand Down