Skip to content

Commit

Permalink
Update kodi-helper
Browse files Browse the repository at this point in the history
Replaces fields that were deprecated in v0.24
  • Loading branch information
Maista6969 committed Jan 20, 2024
1 parent 2e11d35 commit 3690daa
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions scripts/kodi-helper/kodi-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def main():


def generateNFOFiles(args):
if not args.inline and args.outdir == "":
if not (args.inline or args.outdir):
print("--outdir or --inline must be set\n")
return

Expand All @@ -54,6 +54,12 @@ def generateNFOFiles(args):
scenes = getScenes(i, filter)

for scene in scenes:
# skip scenes without files
if not scene["files"]:
continue

# Quick fix for scenes with multiple files
scene["path"] = scene["files"][0]["path"]
# don't regenerate if file already exists and not overwriting
output = getOutputNFOFile(scene["path"], args)
if not args.overwrite and os.path.exists(output):
Expand Down Expand Up @@ -165,11 +171,12 @@ def getScenes(page, sceneFilter):
scenes {
id
title
path
rating
files {
path
}
rating100
details
date
oshash
paths {
screenshot
stream
Expand Down Expand Up @@ -244,8 +251,9 @@ def generateNFO(scene, args):
<tag>{}</tag>""".format(t["name"])

rating = ""
if scene["rating"] != None:
rating = scene["rating"]
if scene["rating100"] != None:
# Kodi uses a 10 point scale, in increments of 0.5
rating = (2 * scene["rating100"] // 10) / 2.0

date = ""
if scene["date"] != None:
Expand Down

0 comments on commit 3690daa

Please sign in to comment.