fix: fetch series name from provider when scanning
Avoid 'Series name cannot be empty' error when a Serie is loaded from a serie_file with an empty name by fetching the title from the provider after year-fetching in the scan() method. fix #?
This commit is contained in:
@@ -454,6 +454,24 @@ class SerieScanner:
|
|||||||
str(e)
|
str(e)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Fetch series name from provider if not already set
|
||||||
|
if not serie.name:
|
||||||
|
try:
|
||||||
|
fetched_name = self.loader.get_title(serie.key)
|
||||||
|
if fetched_name:
|
||||||
|
serie.name = fetched_name
|
||||||
|
logger.info(
|
||||||
|
"Fetched name from provider: %s (name=%s)",
|
||||||
|
serie.key,
|
||||||
|
serie.name
|
||||||
|
)
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(
|
||||||
|
"Could not fetch name for %s: %s",
|
||||||
|
serie.key,
|
||||||
|
str(e)
|
||||||
|
)
|
||||||
|
|
||||||
# Delegate the provider to compare local files with
|
# Delegate the provider to compare local files with
|
||||||
# remote metadata, yielding missing episodes per
|
# remote metadata, yielding missing episodes per
|
||||||
# season. Results are saved back to disk so that both
|
# season. Results are saved back to disk so that both
|
||||||
|
|||||||
Reference in New Issue
Block a user