Skip to content

Commit

Permalink
Fixed common issues
Browse files Browse the repository at this point in the history
  • Loading branch information
westsurname committed Jul 16, 2024
1 parent 40aec84 commit 00333be
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ services:
volumes:
- ${REALDEBRID_MOUNT_TORRENTS_PATH:-${BLACKHOLE_RD_MOUNT_TORRENTS_PATH:-/dev/null}}:${REALDEBRID_MOUNT_TORRENTS_PATH:-${BLACKHOLE_RD_MOUNT_TORRENTS_PATH:-/dev/null}}
- ${TORBOX_MOUNT_TORRENTS_PATH:-/dev/null}:${TORBOX_MOUNT_TORRENTS_PATH:-/dev/null}
- ${SONARR_ROOT_FOLDER_4K}:${SONARR_ROOT_FOLDER}
- ${RADARR_ROOT_FOLDER_4K}:${RADARR_ROOT_FOLDER}
- ${SONARR_ROOT_FOLDER_4K}:${SONARR_ROOT_FOLDER_4K}
- ${RADARR_ROOT_FOLDER_4K}:${RADARR_ROOT_FOLDER_4K}
profiles: [repair_4k, repair_all, all]

repair_anime:
Expand All @@ -117,8 +117,8 @@ services:
volumes:
- ${REALDEBRID_MOUNT_TORRENTS_PATH:-${BLACKHOLE_RD_MOUNT_TORRENTS_PATH:-/dev/null}}:${REALDEBRID_MOUNT_TORRENTS_PATH:-${BLACKHOLE_RD_MOUNT_TORRENTS_PATH:-/dev/null}}
- ${TORBOX_MOUNT_TORRENTS_PATH:-/dev/null}:${TORBOX_MOUNT_TORRENTS_PATH:-/dev/null}
- ${SONARR_ROOT_FOLDER_ANIME}:${SONARR_ROOT_FOLDER}
- ${RADARR_ROOT_FOLDER_ANIME}:${RADARR_ROOT_FOLDER}
- ${SONARR_ROOT_FOLDER_ANIME}:${SONARR_ROOT_FOLDER_ANIME}
- ${RADARR_ROOT_FOLDER_ANIME}:${RADARR_ROOT_FOLDER_ANIME}
profiles: [repair_anime, repair_all, all]

repair_mux:
Expand All @@ -132,8 +132,8 @@ services:
volumes:
- ${REALDEBRID_MOUNT_TORRENTS_PATH:-${BLACKHOLE_RD_MOUNT_TORRENTS_PATH:-/dev/null}}:${REALDEBRID_MOUNT_TORRENTS_PATH:-${BLACKHOLE_RD_MOUNT_TORRENTS_PATH:-/dev/null}}
- ${TORBOX_MOUNT_TORRENTS_PATH:-/dev/null}:${TORBOX_MOUNT_TORRENTS_PATH:-/dev/null}
- ${SONARR_ROOT_FOLDER_MUX}:${SONARR_ROOT_FOLDER}
- ${RADARR_ROOT_FOLDER_MUX}:${RADARR_ROOT_FOLDER}
- ${SONARR_ROOT_FOLDER_MUX}:${SONARR_ROOT_FOLDER_MUX}
- ${RADARR_ROOT_FOLDER_MUX}:${RADARR_ROOT_FOLDER_MUX}
profiles: [repair_mux, repair_all, all]

watchlist:
Expand Down
3 changes: 2 additions & 1 deletion repair.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ def main():
for childFile in childFiles:

fullPath = childFile.path
destinationPath = os.readlink(fullPath)
realPath = os.path.realpath(fullPath)
realPaths.append(realPath)

if os.path.islink(fullPath):
destinationPath = os.readlink(fullPath)

if ((realdebrid['enabled'] and destinationPath.startswith(realdebrid['mountTorrentsPath']) and not os.path.exists(destinationPath)) or
(torbox['enabled'] and destinationPath.startswith(torbox['mountTorrentsPath']) and not os.path.exists(realPath))):
brokenSymlinks.append(realPath)
Expand Down
4 changes: 2 additions & 2 deletions shared/arr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from shared.shared import sonarr, radarr, checkRequiredEnvs

def validateSonarrHost():
url = f"{sonarr['host']}"
url = f"{sonarr['host']}/login"
try:
response = requests.get(url)
return response.status_code == 200
Expand All @@ -23,7 +23,7 @@ def validateSonarrApiKey():
return True

def validateRadarrHost():
url = f"{radarr['host']}"
url = f"{radarr['host']}/login"
try:
response = requests.get(url)
return response.status_code == 200
Expand Down
2 changes: 1 addition & 1 deletion shared/debrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
import re
import hashlib
import bencode3
import requests
from abc import ABC, abstractmethod
from urllib.parse import urljoin
Expand Down Expand Up @@ -493,6 +492,7 @@ class Torrent(TorrentBase):
def getHash(self):

if not self._hash:
import bencode3
self._hash = hashlib.sha1(bencode3.bencode(bencode3.bdecode(self.fileData)['info'])).hexdigest()

return self._hash
Expand Down

0 comments on commit 00333be

Please sign in to comment.