Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arms #123

Merged
merged 2 commits into from
Dec 20, 2022
Merged

Arms #123

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
4 changes: 0 additions & 4 deletions namer/metadataapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,6 @@ def __json_to_fileinfo(data, url: str, json_response: str, name_parts: Optional[
file_info.poster_url = None
if hasattr(data, 'poster'):
file_info.poster_url = data.poster
# if movie and hasattr(data, 'media') and hasattr(data.media, 'url'):
# file_info.poster_url = data.media.url
if movie and hasattr(data, 'image'):
file_info.poster_url = data.image

if hasattr(data, 'background') and data.background:
file_info.background_url = data.background.large
Expand Down
11 changes: 10 additions & 1 deletion namer/videophash.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ class VideoPerceptualHash:
__home_path: Path = Path(__file__).parent
__phash_path: Path = __home_path / 'tools'
__phash_name: str = 'videohashes'
__supported_arch: dict = {
'amd64': 'amd64',
'x86_64': 'amd64',
'arm64': 'arm64',
'arm': 'arm',
}
__phash_suffixes: dict = {
'windows': '.exe',
'linux': '-linux',
Expand All @@ -46,7 +52,10 @@ def __init__(self):
self.__phash_path.mkdir(exist_ok=True, parents=True)

system = platform.system().lower()
self.__phash_name += self.__phash_suffixes[system]
arch = platform.machine().lower()
if arch not in self.__supported_arch.keys():
raise SystemError(f"Unsupport architecture error {arch}")
self.__phash_name += '-' + self.__supported_arch[arch] + self.__phash_suffixes[system]

@lru_cache(maxsize=1024)
def get_phash(self, file: Path) -> Optional[imagehash.ImageHash]:
Expand Down
2 changes: 1 addition & 1 deletion videohashes