mirror of
https://gist.github.com/6ba37e4d4084e858f917e271550ce5f6.git
synced 2024-09-20 00:34:20 +03:00
Improve multiple detection, fix full url
This commit is contained in:
parent
a5ecbcb56d
commit
5ca08554b8
@ -42,8 +42,13 @@ class Library:
|
|||||||
return p
|
return p
|
||||||
# Characters section
|
# Characters section
|
||||||
characters = tags.characters_sanitized()
|
characters = tags.characters_sanitized()
|
||||||
if len(characters) == 1:
|
num = len(characters)
|
||||||
|
if num == 1:
|
||||||
p = p / self.__sanitize(characters[0])
|
p = p / self.__sanitize(characters[0])
|
||||||
|
elif num == 2 and characters[0] in characters[1]:
|
||||||
|
p = p / self.__sanitize(characters[0])
|
||||||
|
elif num == 2 and characters[1] in characters[0]:
|
||||||
|
p = p / self.__sanitize(characters[1])
|
||||||
else:
|
else:
|
||||||
p = p / "_multiple"
|
p = p / "_multiple"
|
||||||
return p
|
return p
|
||||||
|
@ -103,7 +103,7 @@ class PicSorter:
|
|||||||
logging.info("Skipping exists post %d", post_id)
|
logging.info("Skipping exists post %d", post_id)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
meta_result = self.metadata.process("https://danbooru.donmai.us/posts/" + url)
|
meta_result = self.metadata.process("https://danbooru.donmai.us/posts/" + str(post_id))
|
||||||
if meta_result is None:
|
if meta_result is None:
|
||||||
return False
|
return False
|
||||||
image_path, tags = meta_result
|
image_path, tags = meta_result
|
||||||
|
Loading…
Reference in New Issue
Block a user