Save absolute URL for Plex content

Let's be consistent with Emby and Jellyfin
This commit is contained in:
Florian Dupret 2022-01-17 10:26:24 +01:00
commit 3fd43a9845
2 changed files with 4 additions and 4 deletions

View file

@ -104,11 +104,11 @@ namespace Ombi.Helpers
return new ProviderId();
}
public static string GetPlexMediaUrl(string machineId, int mediaId)
public static string GetPlexMediaUrl(string machineId, int mediaId, string plexHost)
{
var url =
$"web/#!/server/{machineId}/details?key=%2flibrary%2Fmetadata%2F{mediaId}";
return url;
return BuildPlexMediaUrl(url, plexHost);
}
public static string BuildPlexMediaUrl(string savedUrl, string plexHost)

View file

@ -351,7 +351,7 @@ namespace Ombi.Schedule.Jobs.Plex
ReleaseYear = movie.year.ToString(),
Type = MediaType.Movie,
Title = movie.title,
Url = PlexHelper.GetPlexMediaUrl(servers.MachineIdentifier, movie.ratingKey),
Url = PlexHelper.GetPlexMediaUrl(servers.MachineIdentifier, movie.ratingKey, servers.ServerHostname),
Seasons = new List<PlexSeasonsContent>(),
Quality = movie.Media?.FirstOrDefault()?.videoResolution ?? string.Empty
};
@ -555,7 +555,7 @@ namespace Ombi.Schedule.Jobs.Plex
ReleaseYear = show.year.ToString(),
Type = MediaType.Series,
Title = show.title,
Url = PlexHelper.GetPlexMediaUrl(servers.MachineIdentifier, show.ratingKey),
Url = PlexHelper.GetPlexMediaUrl(servers.MachineIdentifier, show.ratingKey, servers.ServerHostname),
Seasons = new List<PlexSeasonsContent>()
};
await GetProviderIds(showMetadata, item);