Compare commits
No commits in common. "e15437252e684c4baba3bf28f78c898f97cb5f6f" and "8ed5644f818822095884c0e57e32b022e484a758" have entirely different histories.
e15437252e
...
8ed5644f81
9 changed files with 34 additions and 42 deletions
|
@ -1,17 +0,0 @@
|
|||
def makeKeyWordList(tags):
|
||||
catPaths = {
|
||||
'digitalart/paintings/other': ['Digital Art', 'Paintings']
|
||||
}
|
||||
output = [
|
||||
tags.da_category,
|
||||
tags.license,
|
||||
tags.author.username
|
||||
]
|
||||
|
||||
if tags.is_mature:
|
||||
output.append('is_mature')
|
||||
|
||||
|
||||
for item in .get(tags.category_path,[]):
|
||||
output.append(item)
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
def makeKeyWordList(tags):
|
||||
return [
|
||||
tags.theme,
|
||||
tags.rating,
|
||||
tags.species,
|
||||
tags.gender,
|
||||
tags.artist_url,
|
||||
tags.fa_category
|
||||
]
|
22
main.py
Normal file
22
main.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
# module imports
|
||||
import sys
|
||||
import json
|
||||
import logging
|
||||
|
||||
# init logging
|
||||
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
|
||||
|
||||
# variable init
|
||||
infojson={}
|
||||
source=sys.argv[1]
|
||||
|
||||
logging.info(f"loading info.json for {source}...")
|
||||
with open(f"{source}.json") as file:
|
||||
infojson=json.load(file)
|
||||
|
||||
# TODO: insert method to check url or dict
|
||||
logging.debug("determining file type...")
|
||||
import exif
|
||||
if infojson.extension in exif.allowed_exts:
|
||||
logging.debug(f"exif module supports {infojson.extesnion} files. using it... ")
|
||||
|
|
@ -102,26 +102,22 @@ def writeTags(file, tags):
|
|||
if date in tags:
|
||||
xmptags['Xmp.dc.date'] = tags.date
|
||||
|
||||
from ..misc.getpub import getPub
|
||||
from getpub import getPub
|
||||
xmptags['Xmp.dc.publisher'] = getPub(tags)
|
||||
del getPub
|
||||
|
||||
keywords=[]
|
||||
|
||||
keywords.append(tags.category)
|
||||
if tags in tags: for item in tags.tags: if item not in keywords: keywords.append(item)
|
||||
|
||||
if tags in tags:
|
||||
for item in tags.tags:
|
||||
if item not in keywords: keywords.append(item)
|
||||
if theme in tags and tags.theme not in keywords:
|
||||
keywords.append(tags.theme)
|
||||
|
||||
if tags.category == 'deviantart':
|
||||
from ..category.deviantart import makeKeyWordList
|
||||
for item in makeKeyWordList(tags):
|
||||
if item not in keywords: keywords.append(item)
|
||||
elif tags.category == 'furaffinity':
|
||||
from ..category.furaffinity import makeKeyWordList
|
||||
for item in makeKeyWordList(tags):
|
||||
if item not in keywords: keywords.append(item)
|
||||
|
||||
|
||||
|
||||
if rating in tags and tags.rating not in keywords:
|
||||
keywords.append(tags.rating)
|
||||
|
||||
if species in tags and tags.species not in keywords:
|
||||
keywords.append(tags.species)
|
||||
|
||||
if gender in tags and tags.gender not in keywords:
|
||||
keywords
|
Loading…
Reference in a new issue