feat(titles): use track source attribute for service name in filenames
Allow services to set a custom `source` attribute on tracks, which will be used in the filename instead of the service class name.
This commit is contained in:
@@ -101,9 +101,14 @@ class Song(Title):
|
||||
name = str(self).split(" / ")[1]
|
||||
|
||||
if config.scene_naming:
|
||||
# Service
|
||||
# Service (use track source if available)
|
||||
if show_service:
|
||||
name += f" {self.service.__name__}"
|
||||
source_name = None
|
||||
if self.tracks:
|
||||
first_track = next(iter(self.tracks), None)
|
||||
if first_track and hasattr(first_track, "source") and first_track.source:
|
||||
source_name = first_track.source
|
||||
name += f" {source_name or self.service.__name__}"
|
||||
|
||||
# 'WEB-DL'
|
||||
name += " WEB-DL"
|
||||
|
||||
Reference in New Issue
Block a user