mirror of
https://github.com/JackDallas/Premiumizearr.git
synced 2026-01-29 19:16:56 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4cf1e0a4f | ||
|
|
4cfdee6bc7 | ||
|
|
80506f41d7 | ||
|
|
b63e16b596 |
@@ -24,7 +24,6 @@ type App struct {
|
||||
func (app *App) Lock() {}
|
||||
func (app *App) UnLock() {}
|
||||
|
||||
//Start
|
||||
func (app *App) Start(logLevel string, configFile string, loggingDirectory string) error {
|
||||
//Setup static login
|
||||
lvl, err := log.ParseLevel(logLevel)
|
||||
@@ -98,6 +97,7 @@ func (app *App) Start(logLevel string, configFile string, loggingDirectory strin
|
||||
// Must come after transfer, arrManager and directory
|
||||
app.webServer.Init(&app.transferManager, &app.directoryWatcher, &app.arrsManager, &app.config)
|
||||
|
||||
app.arrsManager.Start()
|
||||
app.webServer.Start()
|
||||
app.directoryWatcher.Start()
|
||||
//Block until the program is terminated
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
|
||||
//Data Access
|
||||
|
||||
//GetHistory: Updates the history if it's been more than 15 seconds since last update
|
||||
// GetHistory: Updates the history if it's been more than 15 seconds since last update
|
||||
func (arr *RadarrArr) GetHistory() (radarr.History, error) {
|
||||
arr.LastUpdateMutex.Lock()
|
||||
defer arr.LastUpdateMutex.Unlock()
|
||||
@@ -78,20 +78,20 @@ func (arr *RadarrArr) GetArrName() string {
|
||||
//Functions
|
||||
|
||||
func (arr *RadarrArr) HistoryContains(name string) (int64, bool) {
|
||||
log.Tracef("Radarr.HistoryContains(): Checking history for %s", name)
|
||||
log.Tracef("Radarr [%s]: Checking history for %s", arr.Name, name)
|
||||
his, err := arr.GetHistory()
|
||||
if err != nil {
|
||||
log.Errorf("Radarr.HistoryContains(): Failed to get history: %+v", err)
|
||||
log.Errorf("Radarr [%s]: Failed to get history: %+v", arr.Name, err)
|
||||
return -1, false
|
||||
}
|
||||
log.Trace("Radarr.HistoryContains(): Got History, now Locking History")
|
||||
log.Trace("Radarr [%s]: Got History, now Locking History", arr.Name)
|
||||
arr.HistoryMutex.Lock()
|
||||
defer arr.HistoryMutex.Unlock()
|
||||
|
||||
name = utils.StripDownloadTypesExtention(name)
|
||||
// name = strings.ReplaceAll(name, ".", " ")
|
||||
for _, item := range his.Records {
|
||||
if item.SourceTitle == name {
|
||||
if utils.StripDownloadTypesExtention(item.SourceTitle) == name || item.SourceTitle == name {
|
||||
return item.ID, true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
|
||||
//Data Access
|
||||
|
||||
//GetHistory: Updates the history if it's been more than 15 seconds since last update
|
||||
// GetHistory: Updates the history if it's been more than 15 seconds since last update
|
||||
func (arr *SonarrArr) GetHistory() (sonarr.History, error) {
|
||||
arr.LastUpdateMutex.Lock()
|
||||
defer arr.LastUpdateMutex.Unlock()
|
||||
@@ -77,22 +77,22 @@ func (arr *SonarrArr) GetArrName() string {
|
||||
// Functions
|
||||
|
||||
func (arr *SonarrArr) HistoryContains(name string) (int64, bool) {
|
||||
log.Tracef("Sonarr.HistoryContains(): Checking history for %s", name)
|
||||
log.Tracef("Sonarr [%s]: Checking history for %s", arr.Name, name)
|
||||
his, err := arr.GetHistory()
|
||||
if err != nil {
|
||||
return 0, false
|
||||
}
|
||||
log.Trace("Sonarr.HistoryContains(): Got History, now Locking History")
|
||||
log.Trace("Sonarr [%s]: Got History, now Locking History")
|
||||
arr.HistoryMutex.Lock()
|
||||
defer arr.HistoryMutex.Unlock()
|
||||
|
||||
name = utils.StripDownloadTypesExtention(name)
|
||||
for _, item := range his.Records {
|
||||
if utils.StripDownloadTypesExtention(item.SourceTitle) == name {
|
||||
if utils.StripDownloadTypesExtention(item.SourceTitle) == name || item.SourceTitle == name {
|
||||
return item.ID, true
|
||||
}
|
||||
}
|
||||
log.Tracef("Sonarr.HistoryContains(): %s Not in History", name)
|
||||
log.Tracef("Sonarr [%s]: %s Not in History", name)
|
||||
|
||||
return -1, false
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ func (am *ArrsManagerService) Init(_config *config.Config) {
|
||||
|
||||
func (am *ArrsManagerService) Start() {
|
||||
am.arrs = []arr.IArr{}
|
||||
log.Debugf("Starting ArrsManagerService")
|
||||
for _, arr_config := range am.config.Arrs {
|
||||
switch arr_config.Type {
|
||||
case config.Sonarr:
|
||||
@@ -38,6 +39,7 @@ func (am *ArrsManagerService) Start() {
|
||||
LastUpdate: time.Now(),
|
||||
}
|
||||
am.arrs = append(am.arrs, &wrapper)
|
||||
log.Tracef("Added Sonarr arr: %s", arr_config.Name)
|
||||
case config.Radarr:
|
||||
c := starr.New(arr_config.APIKey, arr_config.URL, 0)
|
||||
wrapper := arr.RadarrArr{
|
||||
@@ -47,10 +49,12 @@ func (am *ArrsManagerService) Start() {
|
||||
LastUpdate: time.Now(),
|
||||
}
|
||||
am.arrs = append(am.arrs, &wrapper)
|
||||
log.Tracef("Added Radarr arr: %s", arr_config.Name)
|
||||
default:
|
||||
log.Error("Unknown arr type: %s, not adding Arr %s", arr_config.Type, arr_config.Name)
|
||||
}
|
||||
}
|
||||
log.Debugf("Created %d Arrs", len(am.arrs))
|
||||
}
|
||||
|
||||
func (am *ArrsManagerService) Stop() {
|
||||
|
||||
@@ -69,7 +69,7 @@ func (t *TransferManagerService) CleanUpUnzipDir() {
|
||||
log.Errorf("Error cleaning unzip directory: %s", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
func (manager *TransferManagerService) ConfigUpdatedCallback(currentConfig config.Config, newConfig config.Config) {
|
||||
@@ -110,6 +110,7 @@ func (manager *TransferManagerService) TaskUpdateTransfersList() {
|
||||
}
|
||||
manager.updateTransfers(transfers)
|
||||
|
||||
log.Tracef("Checking %d transfers against %d Arr clients", len(transfers), len(manager.arrsManager.GetArrs()))
|
||||
for _, transfer := range transfers {
|
||||
found := false
|
||||
for _, arr := range manager.arrsManager.GetArrs() {
|
||||
|
||||
15970
web/package-lock.json
generated
15970
web/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,7 @@
|
||||
"css-loader": "^5.0.0",
|
||||
"esbuild-loader": "^2.0.0",
|
||||
"mini-css-extract-plugin": "^1.0.0",
|
||||
"svelte": "^3.0.0",
|
||||
"svelte": "^3.49.0",
|
||||
"svelte-loader": "^3.0.0",
|
||||
"webpack": "^5.0.0",
|
||||
"webpack-cli": "^4.0.0",
|
||||
|
||||
Reference in New Issue
Block a user