Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm,linux/arm64
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
45 changes: 23 additions & 22 deletions repair.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,29 +100,28 @@ def main():
print("Broken items:")
[print(item) for item in brokenItems]
print()
if args.dry_run or args.no_confirm or input("Do you want to delete and re-grab? (y/n): ").lower() == 'y':
if not args.dry_run:
discordUpdate(f"[{args.mode}] Repairing {media.title}: {childId}")
if args.mode == 'symlink':
print("Deleting files:")
[print(item.path) for item in childItems]
results = arr.deleteFiles(childItems)
print("Re-monitoring")
media = arr.get(media.id)
media.setChildMonitored(childId, False)
arr.put(media)
media.setChildMonitored(childId, True)
arr.put(media)
print("Searching for new files")
results = arr.automaticSearch(media, childId)
print(results)

if repairIntervalSeconds > 0:
time.sleep(repairIntervalSeconds)
else:
if not args.dry_run and (args.no_confirm or input("Do you want to delete and re-grab? (y/n): ").lower() == 'y'):
discordUpdate(f"[{args.mode}] Repairing {media.title}: {childId}")
if args.mode == 'symlink':
print("Deleting files:")
[print(item.path) for item in childItems]
results = arr.deleteFiles(childItems)
print("Re-monitoring")
media = arr.get(media.id)
media.setChildMonitored(childId, False)
arr.put(media)
media.setChildMonitored(childId, True)
arr.put(media)
print("Searching for new files")
results = arr.automaticSearch(media, childId)
print(results)

if repairIntervalSeconds > 0:
time.sleep(repairIntervalSeconds)
elif not args.dry_run:
print("Skipping")
print()
elif args.mode == 'symlink':
elif args.season_packs and args.mode == 'symlink':
realPaths = [os.path.realpath(item.path) for item in childItems]
parentFolders = set(os.path.dirname(path) for path in realPaths)
if childId in media.fullyAvailableChildrenIds and len(parentFolders) > 1:
Expand All @@ -131,13 +130,15 @@ def main():
print("Non-season-pack folders:")
[print(parentFolder) for parentFolder in parentFolders]
print()
if args.season_packs:
if not args.dry_run and (args.no_confirm or input("Do you want to initiate a search for a season-pack? (y/n): ").lower() == 'y'):
print("Searching for season-pack")
results = arr.automaticSearch(media, childId)
print(results)

if repairIntervalSeconds > 0:
time.sleep(repairIntervalSeconds)
elif not args.dry_run:
print("Skipping")

except Exception:
e = traceback.format_exc()
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
environs==9.5.0 #all
environs==14.2.0 #all
discord_webhook==1.3.0 #all
requests==2.28.1 #all

Expand All @@ -10,4 +10,4 @@ declxml==1.1.3 #plex_request

Werkzeug==3.0.1 #plex_authentication, blackhole
flask==3.0.2 #plex_authentication, plex_request
gunicorn==22.0.0 #plex_authentication, plex_request
gunicorn==22.0.0 #plex_authentication, plex_request