mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-26 22:46:37 -04:00
New: Lidarr to Readarr
This commit is contained in:
@@ -14,9 +14,9 @@ namespace NzbDrone.Core.MetadataSource
|
||||
{
|
||||
private readonly IConfigService _configService;
|
||||
|
||||
private readonly ILidarrCloudRequestBuilder _defaultRequestFactory;
|
||||
private readonly IReadarrCloudRequestBuilder _defaultRequestFactory;
|
||||
|
||||
public MetadataRequestBuilder(IConfigService configService, ILidarrCloudRequestBuilder defaultRequestBuilder)
|
||||
public MetadataRequestBuilder(IConfigService configService, IReadarrCloudRequestBuilder defaultRequestBuilder)
|
||||
{
|
||||
_configService = configService;
|
||||
_defaultRequestFactory = defaultRequestBuilder;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NzbDrone.Core.MetadataSource
|
||||
{
|
||||
public interface IProvideArtistInfo
|
||||
{
|
||||
Artist GetArtistInfo(string lidarrId, int metadataProfileId);
|
||||
Artist GetArtistInfo(string readarrId, int metadataProfileId);
|
||||
HashSet<string> GetChangedArtists(DateTime startTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
|
||||
public Artist GetArtistInfo(string foreignArtistId, int metadataProfileId)
|
||||
{
|
||||
_logger.Debug("Getting Artist with LidarrAPI.MetadataID of {0}", foreignArtistId);
|
||||
_logger.Debug("Getting Artist with ReadarrAPI.MetadataID of {0}", foreignArtistId);
|
||||
|
||||
var httpRequest = _requestBuilder.GetRequestBuilder().Create()
|
||||
.SetSegment("route", "artist/" + foreignArtistId)
|
||||
@@ -145,7 +145,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
|
||||
public Tuple<string, Album, List<ArtistMetadata>> GetAlbumInfo(string foreignAlbumId)
|
||||
{
|
||||
_logger.Debug("Getting Album with LidarrAPI.MetadataID of {0}", foreignAlbumId);
|
||||
_logger.Debug("Getting Album with ReadarrAPI.MetadataID of {0}", foreignAlbumId);
|
||||
|
||||
var httpRequest = _requestBuilder.GetRequestBuilder().Create()
|
||||
.SetSegment("route", "album/" + foreignAlbumId)
|
||||
@@ -186,7 +186,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
{
|
||||
var lowerTitle = title.ToLowerInvariant();
|
||||
|
||||
if (lowerTitle.StartsWith("lidarr:") || lowerTitle.StartsWith("lidarrid:") || lowerTitle.StartsWith("mbid:"))
|
||||
if (lowerTitle.StartsWith("readarr:") || lowerTitle.StartsWith("readarrid:") || lowerTitle.StartsWith("mbid:"))
|
||||
{
|
||||
var slug = lowerTitle.Split(':')[1].Trim();
|
||||
|
||||
@@ -229,12 +229,12 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
throw new SkyHookException("Search for '{0}' failed. Unable to communicate with LidarrAPI.", title);
|
||||
throw new SkyHookException("Search for '{0}' failed. Unable to communicate with ReadarrAPI.", title);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Warn(ex, ex.Message);
|
||||
throw new SkyHookException("Search for '{0}' failed. Invalid response received from LidarrAPI.", title);
|
||||
throw new SkyHookException("Search for '{0}' failed. Invalid response received from ReadarrAPI.", title);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
{
|
||||
var lowerTitle = title.ToLowerInvariant();
|
||||
|
||||
if (lowerTitle.StartsWith("lidarr:") || lowerTitle.StartsWith("lidarrid:") || lowerTitle.StartsWith("mbid:"))
|
||||
if (lowerTitle.StartsWith("readarr:") || lowerTitle.StartsWith("readarrid:") || lowerTitle.StartsWith("mbid:"))
|
||||
{
|
||||
var slug = lowerTitle.Split(':')[1].Trim();
|
||||
|
||||
@@ -296,12 +296,12 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
throw new SkyHookException("Search for '{0}' failed. Unable to communicate with LidarrAPI.", title);
|
||||
throw new SkyHookException("Search for '{0}' failed. Unable to communicate with ReadarrAPI.", title);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Warn(ex, ex.Message);
|
||||
throw new SkyHookException("Search for '{0}' failed. Invalid response received from LidarrAPI.", title);
|
||||
throw new SkyHookException("Search for '{0}' failed. Invalid response received from ReadarrAPI.", title);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,12 +336,12 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
}
|
||||
catch (HttpException)
|
||||
{
|
||||
throw new SkyHookException("Search for '{0}' failed. Unable to communicate with LidarrAPI.", title);
|
||||
throw new SkyHookException("Search for '{0}' failed. Unable to communicate with ReadarrAPI.", title);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Warn(ex, ex.Message);
|
||||
throw new SkyHookException("Search for '{0}' failed. Invalid response received from LidarrAPI.", title);
|
||||
throw new SkyHookException("Search for '{0}' failed. Invalid response received from ReadarrAPI.", title);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user