add update_blank_track_titles

pull/700/head
meisnate12 3 years ago
parent 6d442397b5
commit c353f9975a

@ -1 +1 @@
1.15.1-develop47
1.15.1-develop48

@ -559,7 +559,8 @@ class ConfigFile:
"sonarr_remove_by_tag": None,
"mass_collection_mode": None,
"metadata_backup": None,
"genre_collections": None
"genre_collections": None,
"update_blank_track_titles": None
}
display_name = f"{params['name']} ({params['mapping_name']})" if lib and "library_name" in lib and lib["library_name"] else params["mapping_name"]
@ -638,6 +639,8 @@ class ConfigFile:
params["sonarr_add_all_existing"] = check_for_attribute(lib["operations"], "sonarr_add_all_existing", var_type="bool", default=False, save=False)
if "sonarr_remove_by_tag" in lib["operations"]:
params["sonarr_remove_by_tag"] = check_for_attribute(lib["operations"], "sonarr_remove_by_tag", var_type="comma_list", default=False, save=False)
if "update_blank_track_titles" in lib["operations"]:
params["update_blank_track_titles"] = check_for_attribute(lib["operations"], "update_blank_track_titles", var_type="bool", default=False, save=False)
if "mass_collection_mode" in lib["operations"]:
try:
params["mass_collection_mode"] = util.check_collection_mode(lib["operations"]["mass_collection_mode"])

@ -75,6 +75,7 @@ class Library(ABC):
self.radarr_remove_by_tag = params["radarr_remove_by_tag"]
self.sonarr_add_all_existing = params["sonarr_add_all_existing"]
self.sonarr_remove_by_tag = params["sonarr_remove_by_tag"]
self.update_blank_track_titles = params["update_blank_track_titles"]
self.mass_collection_mode = params["mass_collection_mode"]
self.metadata_backup = params["metadata_backup"]
self.tmdb_collections = params["tmdb_collections"]
@ -94,7 +95,7 @@ class Library(ABC):
or self.tmdb_collections or self.radarr_add_all_existing or self.sonarr_add_all_existing
self.library_operation = self.items_library_operation or self.delete_unmanaged_collections or self.delete_collections_with_less \
or self.radarr_remove_by_tag or self.sonarr_remove_by_tag or self.mass_collection_mode \
or self.genre_collections or self.show_unmanaged or self.metadata_backup
or self.genre_collections or self.show_unmanaged or self.metadata_backup or self.update_blank_track_titles
if self.asset_directory:
logger.info("")

@ -415,6 +415,10 @@ class Plex(Library):
self.is_other = self.agent == "com.plexapp.agents.none"
if self.is_other:
self.type = "Video"
if not self.is_music and self.update_blank_track_titles:
self.update_blank_track_titles = False
logger.error(f"update_blank_track_titles library operation only works with music libraries")
if self.tmdb_collections and self.is_show:
self.tmdb_collections = None
logger.error("Config Error: tmdb_collections only work with Movie Libraries.")

@ -443,6 +443,7 @@ def library_operations(config, library):
logger.debug(f"Radarr Remove by Tag: {library.radarr_remove_by_tag}")
logger.debug(f"Sonarr Add All Existing: {library.sonarr_add_all_existing}")
logger.debug(f"Sonarr Remove by Tag: {library.sonarr_remove_by_tag}")
logger.debug(f"Update Blank Track Titles: {library.update_blank_track_titles}")
logger.debug(f"TMDb Collections: {library.tmdb_collections}")
logger.debug(f"Genre Collections: {library.genre_collections}")
logger.debug(f"Genre Mapper: {library.genre_mapper}")
@ -456,6 +457,11 @@ def library_operations(config, library):
item.split()
logger.info(util.adjust_space(f"{item.title[:25]:<25} | Splitting"))
if library.update_blank_track_titles:
for item in library.get_all(collection_level="track"):
if not item.title and item.sortTitle:
library.edit_query(item, {"title.locked": 1, "title.value": item.sortTitle})
tmdb_collections = {}
if library.items_library_operation:
items = library.get_all(load=True)

Loading…
Cancel
Save