mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
Daily series status will be fetched from API on data refresh
This commit is contained in:
@@ -11,6 +11,7 @@ namespace NzbDrone.Core.DataAugmentation.DailySeries
|
||||
public interface IDailySeriesDataProxy
|
||||
{
|
||||
IEnumerable<int> GetDailySeriesIds();
|
||||
bool IsDailySeries(int tvdbid);
|
||||
}
|
||||
|
||||
public class DailySeriesDataProxy : IDailySeriesDataProxy
|
||||
@@ -43,5 +44,19 @@ namespace NzbDrone.Core.DataAugmentation.DailySeries
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public bool IsDailySeries(int tvdbid)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = _httpProvider.DownloadString(_configService.ServiceRootUrl + "/DailySeries/Check?seriesId=" + tvdbid);
|
||||
return Convert.ToBoolean(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.WarnException("Failed to check Daily Series status for: " + tvdbid, ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,13 @@ using NzbDrone.Core.Tv;
|
||||
|
||||
namespace NzbDrone.Core.DataAugmentation.DailySeries
|
||||
{
|
||||
public class DailySeriesService
|
||||
public interface IDailySeriesService
|
||||
{
|
||||
void UpdateDailySeries();
|
||||
bool IsDailySeries(int tvdbid);
|
||||
}
|
||||
|
||||
public class DailySeriesService : IDailySeriesService
|
||||
{
|
||||
//TODO: add timer command
|
||||
|
||||
@@ -15,7 +21,7 @@ namespace NzbDrone.Core.DataAugmentation.DailySeries
|
||||
_seriesService = seriesService;
|
||||
}
|
||||
|
||||
public virtual void UpdateDailySeries()
|
||||
public void UpdateDailySeries()
|
||||
{
|
||||
var dailySeries = _proxy.GetDailySeriesIds();
|
||||
|
||||
@@ -29,5 +35,10 @@ namespace NzbDrone.Core.DataAugmentation.DailySeries
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsDailySeries(int tvdbid)
|
||||
{
|
||||
return _proxy.IsDailySeries(tvdbid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user