mirror of
https://github.com/stashapp/CommunityScripts.git
synced 2026-04-20 11:06:18 -05:00
Update kodi-helper
Replaces fields that were deprecated in v0.24
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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):
|
||||
@@ -165,11 +171,12 @@ query findScenes($filter: FindFilterType!, $scene_filter: SceneFilterType!) {
|
||||
scenes {
|
||||
id
|
||||
title
|
||||
path
|
||||
rating
|
||||
files {
|
||||
path
|
||||
}
|
||||
rating100
|
||||
details
|
||||
date
|
||||
oshash
|
||||
paths {
|
||||
screenshot
|
||||
stream
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user