Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions namer/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ class NamerConfig:
Write an nfo file next to the directory in an emby/jellyfin readable format.
"""

write_performer_poster: bool = False
"""
Write performar images in the same folder as the show
"""

trailer_location: Optional[str] = ''
"""
If you want the trailers downloaded set the value relative to the final location of the movie file here.
Expand Down Expand Up @@ -503,6 +508,7 @@ def to_dict(self) -> dict:
},
"Tagging Config": {
"write_nfo": self.write_nfo,
"write_performer_poster": self.write_performer_poster,
"enabled_tagging": self.enabled_tagging,
"enabled_poster": self.enabled_poster,
"download_type": self.download_type,
Expand Down
1 change: 1 addition & 0 deletions namer/configuration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def set_boolean(updater: ConfigUpdater, section: str, key: str, value: bool) ->
"use_gpu": ("Phash", to_bool, from_bool),
"mark_collected": ("metadata", to_bool, from_bool),
"write_nfo": ("metadata", to_bool, from_bool),
"write_performer_poster": ("metadata", to_bool, from_bool),
"enabled_tagging": ("metadata", to_bool, from_bool),
"enabled_poster": ("metadata", to_bool, from_bool),
"download_type": ("metadata", to_str_list_lower, from_str_list_lower),
Expand Down
8 changes: 4 additions & 4 deletions namer/moviexml.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def write_movie_xml_file(info: LookedUpFileInfo, config: NamerConfig, trailer: O
add_sub_element(doc, root, 'genre', config.default_genre)

add_sub_element(doc, root, 'studio', info.site)
add_sub_element(doc, root, 'theporndbid', str(info.uuid))
add_sub_element(doc, root, 'theporndbguid', str(info.guid))
add_sub_element(doc, root, 'theporndbid', str(info.uuid).strip('scene/'))
add_sub_element(doc, root, 'theporndbguid', str(info.uuid).strip('scene/'))
add_sub_element(doc, root, 'phoenixadultid')
add_sub_element(doc, root, 'phoenixadulturlid')

Expand All @@ -133,8 +133,8 @@ def write_movie_xml_file(info: LookedUpFileInfo, config: NamerConfig, trailer: O
add_sub_element(doc, actor, 'type', 'Actor')
add_sub_element(doc, actor, 'name', performer.name)
add_sub_element(doc, actor, 'role', performer.role)

if performer.image:
if config.write_performer_poster and performer.image:
image = performer.image.name if isinstance(performer.image, Path) else performer.image
add_sub_element(doc, actor, 'image', image)

Expand Down
3 changes: 3 additions & 0 deletions namer/namer.cfg.default
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ use_gpu = False
# Write an nfo file next to the directory in an emby/jellyfin readable format
write_nfo = False

# Write performar images in the same folder as the show
write_performer_poster = False

# Should metadata fetched from the porn db be written in to the metadata of the mp4.
enabled_tagging = True

Expand Down
6 changes: 4 additions & 2 deletions namer/namer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from namer.command import make_command, move_command_files, move_to_final_location, set_permissions, write_log_file
from namer.ffmpeg import FFProbeResults
from namer.fileinfo import FileInfo
from namer.metadataapi import get_complete_metadataapi_net_fileinfo, get_image, get_trailer, match, share_hash, toggle_collected
from namer.metadataapi import get_complete_metadataapi_net_fileinfo, get_image, get_trailer, match, share_oshash, share_phash, toggle_collected
from namer.moviexml import parse_movie_xml_file, write_nfo
from namer.name_formatter import PartialFormatter
from namer.mutagen import update_mp4_file
Expand Down Expand Up @@ -244,7 +244,8 @@ def add_extra_artifacts(video_file: Path, new_metadata: LookedUpFileInfo, search
poster = get_image(new_metadata.poster_url, "-poster", video_file, config) if new_metadata.poster_url and config.enabled_poster and ImageDownloadType.POSTER in config.download_type else None
background = get_image(new_metadata.background_url, "-background", video_file, config) if new_metadata.background_url and config.enabled_poster and ImageDownloadType.BACKGROUND in config.download_type else None
for performer in new_metadata.performers:
if isinstance(performer.image, str):
logger.info("Download Performer Image WPF: {}", config.write_performer_poster)
if config.write_performer_poster and isinstance(performer.image, str):
performer_image = get_image(performer.image, "-Performer-" + performer.name.replace(" ", "-") + "-image", video_file, config) if performer.image and config.enabled_poster and ImageDownloadType.PERFORMER in config.download_type else None
if performer_image:
performer.image = performer_image
Expand Down Expand Up @@ -315,3 +316,4 @@ def main(arg_list: List[str]):
command = make_command(target.absolute(), config, inplace=True, nfo=args.infos)
if command is not None:
process_file(command)

Loading