mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-10-29 23:12:39 +01:00
parent
c08b451564
commit
b848100693
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
@ -102,7 +102,7 @@ namespace NzbDrone.Core.Test.MetadataSource.SkyHook
|
||||
episode.AirDateUtc.Value.Kind.Should().Be(DateTimeKind.Utc);
|
||||
}
|
||||
|
||||
episode.Images.Any(i => i.CoverType == MediaCoverTypes.Screenshot && i.Url.Contains("-940."))
|
||||
episode.Images.Any(i => i.CoverType == MediaCoverTypes.Screenshot && i.RemoteUrl.Contains("-940."))
|
||||
.Should()
|
||||
.BeFalse();
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(183)]
|
||||
public class update_images_remote_url : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Execute.Sql("UPDATE Episodes SET Images = REPLACE(Images, '\"url\"', '\"remoteUrl\"')");
|
||||
Execute.Sql("UPDATE Series SET Images = REPLACE(Images, '\"url\"', '\"remoteUrl\"'), Actors = REPLACE(Actors, '\"url\"', '\"remoteUrl\"'), Seasons = REPLACE(Seasons, '\"url\"', '\"remoteUrl\"')");
|
||||
}
|
||||
}
|
||||
}
|
@ -227,7 +227,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Roksbox
|
||||
var filename = Path.GetFileName(seasonFolder) + ".jpg";
|
||||
var path = series.Path.GetRelativePath(Path.Combine(series.Path, seasonFolder, filename));
|
||||
|
||||
return new List<ImageFileResult> { new ImageFileResult(path, image.Url) };
|
||||
return new List<ImageFileResult> { new ImageFileResult(path, image.RemoteUrl) };
|
||||
}
|
||||
|
||||
public override List<ImageFileResult> EpisodeImages(Series series, EpisodeFile episodeFile)
|
||||
@ -245,7 +245,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Roksbox
|
||||
return new List<ImageFileResult>();
|
||||
}
|
||||
|
||||
return new List<ImageFileResult> { new ImageFileResult(GetEpisodeImageFilename(episodeFile.RelativePath), screenshot.Url) };
|
||||
return new List<ImageFileResult> { new ImageFileResult(GetEpisodeImageFilename(episodeFile.RelativePath), screenshot.RemoteUrl) };
|
||||
}
|
||||
|
||||
private string GetEpisodeMetadataFilename(string episodeFilePath)
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@ -220,7 +220,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Wdtv
|
||||
|
||||
var path = Path.Combine(seasonFolder, "folder.jpg");
|
||||
|
||||
return new List<ImageFileResult> { new ImageFileResult(path, image.Url) };
|
||||
return new List<ImageFileResult> { new ImageFileResult(path, image.RemoteUrl) };
|
||||
}
|
||||
|
||||
public override List<ImageFileResult> EpisodeImages(Series series, EpisodeFile episodeFile)
|
||||
@ -238,7 +238,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Wdtv
|
||||
return new List<ImageFileResult>();
|
||||
}
|
||||
|
||||
return new List<ImageFileResult> { new ImageFileResult(GetEpisodeImageFilename(episodeFile.RelativePath), screenshot.Url) };
|
||||
return new List<ImageFileResult> { new ImageFileResult(GetEpisodeImageFilename(episodeFile.RelativePath), screenshot.RemoteUrl) };
|
||||
}
|
||||
|
||||
private string GetEpisodeMetadataFilename(string episodeFilePath)
|
||||
|
@ -205,7 +205,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
||||
|
||||
if (actor.Images.Any())
|
||||
{
|
||||
xmlActor.Add(new XElement("thumb", actor.Images.First().Url));
|
||||
xmlActor.Add(new XElement("thumb", actor.Images.First().RemoteUrl));
|
||||
}
|
||||
|
||||
tvShow.Add(xmlActor);
|
||||
@ -287,7 +287,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
||||
}
|
||||
else
|
||||
{
|
||||
details.Add(new XElement("thumb", image.Url));
|
||||
details.Add(new XElement("thumb", image.RemoteUrl));
|
||||
}
|
||||
|
||||
details.Add(new XElement("watched", watched));
|
||||
@ -394,7 +394,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
||||
|
||||
return new List<ImageFileResult>
|
||||
{
|
||||
new ImageFileResult(GetEpisodeImageFilename(episodeFile.RelativePath), screenshot.Url)
|
||||
new ImageFileResult(GetEpisodeImageFilename(episodeFile.RelativePath), screenshot.RemoteUrl)
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -427,7 +427,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
||||
filename = string.Format("season-specials-{0}.jpg", image.CoverType.ToString().ToLower());
|
||||
}
|
||||
|
||||
yield return new ImageFileResult(filename, image.Url);
|
||||
yield return new ImageFileResult(filename, image.RemoteUrl);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,10 +22,10 @@ namespace NzbDrone.Core.MediaCover
|
||||
{
|
||||
}
|
||||
|
||||
public MediaCover(MediaCoverTypes coverType, string url)
|
||||
public MediaCover(MediaCoverTypes coverType, string remoteUrl)
|
||||
{
|
||||
CoverType = coverType;
|
||||
Url = url;
|
||||
RemoteUrl = remoteUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +77,6 @@ namespace NzbDrone.Core.MediaCover
|
||||
// Series isn't in Sonarr yet, map via a proxy to circument referrer issues
|
||||
foreach (var mediaCover in covers)
|
||||
{
|
||||
mediaCover.RemoteUrl = mediaCover.Url;
|
||||
mediaCover.Url = _mediaCoverProxy.RegisterUrl(mediaCover.RemoteUrl);
|
||||
}
|
||||
}
|
||||
@ -87,7 +86,6 @@ namespace NzbDrone.Core.MediaCover
|
||||
{
|
||||
var filePath = GetCoverPath(seriesId, mediaCover.CoverType);
|
||||
|
||||
mediaCover.RemoteUrl = mediaCover.Url;
|
||||
mediaCover.Url = _configFileProvider.UrlBase + @"/MediaCover/" + seriesId + "/" + mediaCover.CoverType.ToString().ToLower() + ".jpg";
|
||||
|
||||
if (_diskProvider.FileExists(filePath))
|
||||
@ -115,7 +113,7 @@ namespace NzbDrone.Core.MediaCover
|
||||
var alreadyExists = false;
|
||||
try
|
||||
{
|
||||
alreadyExists = _coverExistsSpecification.AlreadyExists(cover.Url, fileName);
|
||||
alreadyExists = _coverExistsSpecification.AlreadyExists(cover.RemoteUrl, fileName);
|
||||
if (!alreadyExists)
|
||||
{
|
||||
DownloadCover(series, cover);
|
||||
@ -159,8 +157,8 @@ namespace NzbDrone.Core.MediaCover
|
||||
{
|
||||
var fileName = GetCoverPath(series.Id, cover.CoverType);
|
||||
|
||||
_logger.Info("Downloading {0} for {1} {2}", cover.CoverType, series, cover.Url);
|
||||
_httpClient.DownloadFile(cover.Url, fileName);
|
||||
_logger.Info("Downloading {0} for {1} {2}", cover.CoverType, series, cover.RemoteUrl);
|
||||
_httpClient.DownloadFile(cover.RemoteUrl, fileName);
|
||||
}
|
||||
|
||||
private void EnsureResizedCovers(Series series, MediaCover cover, bool forceResize)
|
||||
|
@ -310,7 +310,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
{
|
||||
return new MediaCover.MediaCover
|
||||
{
|
||||
Url = arg.Url,
|
||||
RemoteUrl = arg.Url,
|
||||
CoverType = MapCoverType(arg.CoverType)
|
||||
};
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||
{
|
||||
embed.Thumbnail = new DiscordImage
|
||||
{
|
||||
Url = series.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Poster)?.Url
|
||||
Url = series.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Poster)?.RemoteUrl
|
||||
};
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||
{
|
||||
embed.Image = new DiscordImage
|
||||
{
|
||||
Url = series.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Fanart)?.Url
|
||||
Url = series.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Fanart)?.RemoteUrl
|
||||
};
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||
{
|
||||
embed.Thumbnail = new DiscordImage
|
||||
{
|
||||
Url = series.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Poster)?.Url
|
||||
Url = series.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Poster)?.RemoteUrl
|
||||
};
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ namespace NzbDrone.Core.Notifications.Discord
|
||||
{
|
||||
embed.Image = new DiscordImage
|
||||
{
|
||||
Url = series.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Fanart)?.Url
|
||||
Url = series.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Fanart)?.RemoteUrl
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ namespace NzbDrone.Core.Notifications.Gotify
|
||||
|
||||
if (Settings.IncludeSeriesPoster && series != null)
|
||||
{
|
||||
var poster = series.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Poster)?.Url;
|
||||
var poster = series.Images.FirstOrDefault(x => x.CoverType == MediaCoverTypes.Poster)?.RemoteUrl;
|
||||
|
||||
if (poster != null)
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Languages;
|
||||
using NzbDrone.Core.MediaCover;
|
||||
using NzbDrone.Core.Tv;
|
||||
@ -100,7 +101,9 @@ namespace Sonarr.Api.V3.Series
|
||||
// PreviousAiring
|
||||
Network = model.Network,
|
||||
AirTime = model.AirTime,
|
||||
Images = model.Images,
|
||||
|
||||
// JsonClone
|
||||
Images = model.Images.JsonClone(),
|
||||
|
||||
Seasons = model.Seasons.ToResource(includeSeasonImages),
|
||||
Year = model.Year,
|
||||
|
Loading…
Reference in New Issue
Block a user