mirror of
https://github.com/RicterZ/nhentai.git
synced 2025-06-09 06:29:05 +02:00
reformat file
This commit is contained in:
parent
4df8e1bae0
commit
9e537e60f2
@ -2,6 +2,7 @@
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
def serialize(doujinshi, dir):
|
def serialize(doujinshi, dir):
|
||||||
metadata = {'title': doujinshi.name,
|
metadata = {'title': doujinshi.name,
|
||||||
'subtitle': doujinshi.info.subtitle}
|
'subtitle': doujinshi.info.subtitle}
|
||||||
@ -22,6 +23,7 @@ def serialize(doujinshi, dir):
|
|||||||
metadata['category'] = doujinshi.info.categories
|
metadata['category'] = doujinshi.info.categories
|
||||||
metadata['URL'] = doujinshi.url
|
metadata['URL'] = doujinshi.url
|
||||||
metadata['Pages'] = doujinshi.pages
|
metadata['Pages'] = doujinshi.pages
|
||||||
|
|
||||||
with open(os.path.join(dir, 'metadata.json'), 'w', encoding="raw_unicode_escape") as f:
|
with open(os.path.join(dir, 'metadata.json'), 'w', encoding="raw_unicode_escape") as f:
|
||||||
json.dump(metadata, f, separators=','':')
|
json.dump(metadata, f, separators=','':')
|
||||||
|
|
||||||
@ -37,7 +39,6 @@ def merge_json():
|
|||||||
continue
|
continue
|
||||||
data_folder = output_dir + folder + '/' + 'metadata.json'
|
data_folder = output_dir + folder + '/' + 'metadata.json'
|
||||||
json_file = open(data_folder, 'r')
|
json_file = open(data_folder, 'r')
|
||||||
json_dict = {}
|
|
||||||
json_dict = json.load(json_file)
|
json_dict = json.load(json_file)
|
||||||
json_dict['Folder'] = folder
|
json_dict['Folder'] = folder
|
||||||
lst.append(json_dict)
|
lst.append(json_dict)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user