mirror of
https://github.com/C5H12O5/syno-videoinfo-plugin.git
synced 2025-07-22 00:35:04 +00:00
Convert the rating field to a numerical data type
This commit is contained in:
@ -54,7 +54,7 @@
|
||||
"extra": {
|
||||
"[plugin_id]": {
|
||||
"rating": {
|
||||
"[plugin_id]": "['xp_text', './/ratingValue']"
|
||||
"[plugin_id]": "['xp_text', './/ratingValue', 'float']"
|
||||
},
|
||||
"poster": "['xp_texts', './image', 're_sub', '(.+/photo)/s_ratio_poster/(public/.+)', '\\\\1/m/\\\\2']",
|
||||
"backdrop": "['xp_texts', './image', 're_sub', '(.+/photo)/s_ratio_poster/(public/.+)', '\\\\1/l/\\\\2']"
|
||||
|
@ -64,7 +64,7 @@
|
||||
}
|
||||
},
|
||||
"rating": {
|
||||
"[plugin_id]": "['xp_text', './/ratingValue']"
|
||||
"[plugin_id]": "['xp_text', './/ratingValue', 'float']"
|
||||
},
|
||||
"poster": "['xp_texts', './image', 're_sub', '(.+/photo)/s_ratio_poster/(public/.+)', '\\\\1/m/\\\\2']"
|
||||
}
|
||||
|
@ -57,14 +57,14 @@
|
||||
"extra": {
|
||||
"[plugin_id]": {
|
||||
"rating": {
|
||||
"[plugin_id]": "['xp_text', './movie/sc']"
|
||||
"[plugin_id]": "['xp_text', './movie/sc', 'float']"
|
||||
},
|
||||
"poster": "['xp_texts', './movie/img']",
|
||||
"backdrop": "['xp_texts', './movie/img']"
|
||||
}
|
||||
}
|
||||
},
|
||||
"publish_date": "['xp_text', './movie/pubDate', 'strftime', '%Y-%m-%d']",
|
||||
"publish_date": "['xp_text', './movie/pubDate', 'strftime', '%Y-%m-%d', 'True']",
|
||||
"available_date": "{$parent[available]}"
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"publish_date": "['xp_text', './movie/pubDate', 'strftime', '%Y-%m-%d']",
|
||||
"publish_date": "['xp_text', './movie/pubDate', 'strftime', '%Y-%m-%d', 'True']",
|
||||
"available_date": "{$parent[available]}"
|
||||
}
|
||||
}
|
||||
|
@ -68,13 +68,13 @@
|
||||
}
|
||||
},
|
||||
"rating": {
|
||||
"[plugin_id]": "['xp_text', './movie/sc']"
|
||||
"[plugin_id]": "['xp_text', './movie/sc', 'float']"
|
||||
},
|
||||
"poster": "['xp_texts', './movie/img']"
|
||||
}
|
||||
}
|
||||
},
|
||||
"publish_date": "['xp_text', './movie/pubDate', 'strftime', '%Y-%m-%d']",
|
||||
"publish_date": "['xp_text', './movie/pubDate', 'strftime', '%Y-%m-%d', 'True']",
|
||||
"available_date": "{$parent[available]}"
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@
|
||||
"extra": {
|
||||
"[plugin_id]": {
|
||||
"rating": {
|
||||
"[plugin_id]": "['xp_text', './data/basic/overallRating']"
|
||||
"[plugin_id]": "['xp_text', './data/basic/overallRating', 'float']"
|
||||
},
|
||||
"poster": "['xp_texts', './data/basic/img']",
|
||||
"backdrop": "['xp_texts', './data/basic/bigImage']"
|
||||
|
@ -77,7 +77,7 @@
|
||||
}
|
||||
},
|
||||
"rating": {
|
||||
"[plugin_id]": "['xp_text', './data/basic/overallRating']"
|
||||
"[plugin_id]": "['xp_text', './data/basic/overallRating', 'float']"
|
||||
},
|
||||
"poster": "['xp_texts', './data/basic/img']"
|
||||
}
|
||||
|
@ -69,13 +69,27 @@
|
||||
"director": "['re_matches', '\"name\":\"([^\"]*?)\"[^{{}}]*?\"department\":\"Directing\"']",
|
||||
"extra": {
|
||||
"[plugin_id]": {
|
||||
"rating": {
|
||||
"[plugin_id]": "['xp_text', './vote_average', 're_sub', '(\\d+\\.\\d)\\d*', '\\\\1']"
|
||||
},
|
||||
"poster": ["['xp_text', './poster_path', 'prefix', 'https://image.tmdb.org/t/p/w500']"],
|
||||
"backdrop": ["['xp_text', './backdrop_path', 'prefix', 'https://image.tmdb.org/t/p/original']"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"rating": "['xp_text', './vote_average', 're_sub', '(\\d+\\.\\d)\\d*', '\\\\1']"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"collect": {
|
||||
"source": "rating",
|
||||
"into": {
|
||||
"movie": {
|
||||
"extra": {
|
||||
"[plugin_id]": {
|
||||
"rating": {
|
||||
"[plugin_id]": "['re_match', '(.*)', 'float']"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,13 +106,11 @@
|
||||
"director": "['re_matches', '\"department\":\"Directing\"[^{{}}]*?\"name\":\"([^\"]*?)\"']",
|
||||
"extra": {
|
||||
"[plugin_id]": {
|
||||
"rating": {
|
||||
"[plugin_id]": "['xp_text', './vote_average', 're_sub', '(\\d+\\.\\d)\\d*', '\\\\1']"
|
||||
},
|
||||
"poster": ["['xp_text', './still_path', 'prefix', 'https://image.tmdb.org/t/p/w500']"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"rating": "['xp_text', './vote_average', 're_sub', '(\\d+\\.\\d)\\d*', '\\\\1']"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -126,6 +124,22 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"collect": {
|
||||
"source": "rating",
|
||||
"into": {
|
||||
"episode": {
|
||||
"extra": {
|
||||
"[plugin_id]": {
|
||||
"rating": {
|
||||
"[plugin_id]": "['re_match', '(.*)', 'float']"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"retval": {
|
||||
"source": "episode"
|
||||
|
@ -148,6 +148,8 @@ def _modify(result: Any, strategy: str, args: list):
|
||||
args_len = len(args)
|
||||
if strategy == "int":
|
||||
result = int(result)
|
||||
if strategy == "float":
|
||||
result = float(result)
|
||||
elif strategy == "split" and args_len == 1:
|
||||
result = result.split(args[0])
|
||||
elif strategy == "prefix" and args_len == 1:
|
||||
|
Reference in New Issue
Block a user