Compare commits

4 Commits

Author SHA1 Message Date
Jack Dallas
b4cf1e0a4f Improve filename matching for failed downloads 2022-08-11 23:42:07 +01:00
Jack Dallas
4cfdee6bc7 Start arr manager service 2022-08-11 12:52:25 +01:00
dependabot[bot]
80506f41d7 Bump terser from 5.14.0 to 5.14.2 in /web
Bumps [terser](https://github.com/terser/terser) from 5.14.0 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-22 17:16:47 +01:00
dependabot[bot]
b63e16b596 Bump svelte from 3.48.0 to 3.49.0 in /web
Bumps [svelte](https://github.com/sveltejs/svelte) from 3.48.0 to 3.49.0.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/compare/v3.48.0...v3.49.0)

---
updated-dependencies:
- dependency-name: svelte
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-20 14:40:54 +01:00
7 changed files with 8003 additions and 7998 deletions

View File

@@ -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

View File

@@ -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
}
}

View File

@@ -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
}

View File

@@ -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() {

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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",