mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 19:40:05 -07:00
#150 start caching plex media as well. refactored the availability checker. NEEDS TESTING. also, we need to make the Requests hit the plex api directly rather than hitting the cache as it does now.
This commit is contained in:
parent
e707837bf5
commit
718e8868c1
16 changed files with 808 additions and 601 deletions
|
@ -41,6 +41,7 @@ using PlexRequests.Helpers;
|
|||
using PlexRequests.Services.Interfaces;
|
||||
using PlexRequests.Store;
|
||||
using PlexRequests.Store.Repository;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PlexRequests.Services
|
||||
{
|
||||
|
@ -53,7 +54,7 @@ namespace PlexRequests.Services
|
|||
var repo = new SettingsJsonRepository(dbConfig, memCache);
|
||||
|
||||
ConfigurationReader = new ConfigurationReader();
|
||||
Checker = new PlexAvailabilityChecker(new SettingsServiceV2<PlexSettings>(repo), new SettingsServiceV2<AuthenticationSettings>(repo), new JsonRequestService(new RequestJsonRepository(dbConfig, memCache)), new PlexApi());
|
||||
Checker = new PlexAvailabilityChecker(new SettingsServiceV2<PlexSettings>(repo), new SettingsServiceV2<AuthenticationSettings>(repo), new JsonRequestService(new RequestJsonRepository(dbConfig, memCache)), new PlexApi(), memCache);
|
||||
HostingEnvironment.RegisterObject(this);
|
||||
}
|
||||
|
||||
|
@ -67,6 +68,7 @@ namespace PlexRequests.Services
|
|||
{
|
||||
UpdateSubscription?.Dispose();
|
||||
|
||||
Task.Factory.StartNew(() => Checker.CheckAndUpdateAll(-1)); // cache the libraries and run the availability checks
|
||||
UpdateSubscription = Observable.Interval(c.Intervals.Notification).Subscribe(Checker.CheckAndUpdateAll);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue