Skip to content

Commit

Permalink
Arms (#123)
Browse files Browse the repository at this point in the history
* remove poster avoidance from movies

* Support arm/arm64 as well

Co-authored-by: 4c0d3r <nope>
  • Loading branch information
4c0d3r authored Dec 20, 2022
1 parent 04a6639 commit cd9d315
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
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

0 comments on commit cd9d315

Please sign in to comment.