Trying to fix issues with summary and Ampersand in title

This commit is contained in:
FrederikBaerentsen 2023-05-17 20:29:52 +02:00
parent c9dc8307b7
commit 8c69a958de
3 changed files with 40 additions and 38 deletions

10
main.py
View File

@ -245,7 +245,7 @@ def import2sql():
@app.route("/content/<path:path>")
@auth.login_required
def send_content(path):
print('content')
#print('content')
return send_from_directory(config.CONTENT_BASE_DIR, path)
@app.route("/image/<path:path>")
@ -267,10 +267,10 @@ def catalog(path=""):
c = fromdir(request.root_url, request.url, config.CONTENT_BASE_DIR, path)
#print("c: ")
#pprint(vars(c))
for x in c.entries:
for y in x.links:
pprint(y.href)
print("------")
#for x in c.entries:
# for y in x.links:
# pprint(y.href)
#print("------")
elapsed = timeit.default_timer() - start_time
print("-----------------------------------------------------------------------------------------------------------------------")
print("RENDERED IN: " + str(round(elapsed,2))+"s")

View File

@ -55,12 +55,12 @@ class Entry(object):
#print(kwargs)
#print(kwargs["links"][0].get("rpath"))
#print("--end entry.py")
try:
if kwargs["links"][0].get("type") == 'application/x-cbz':
f=self.links[0].get("rpath")+"/"+self.title+".cbz"
if os.path.exists(f):
s = zipfile.ZipFile(f)
self.size = extras.get_size(f, 'mb')
#self.size = extras.get_size(f, 'mb')
data=BeautifulSoup(s.open('ComicInfo.xml').read(), "xml")
#self.cover=s.open('P00001.jpg').read()
@ -69,7 +69,7 @@ class Entry(object):
else:
config._print("No Writer found: " + str(data.select('Writer')))
self.cover = "/image/" + extras.get_cvdb(data.select('Notes')) + ".jpg"
#self.cover = "/image/" + extras.get_cvdb(data.select('Notes')) + ".jpg"
if data.select('Summary') != []:
self.summary = data.select('Summary')[0].text
@ -94,6 +94,8 @@ class Entry(object):
else:
self.title = kwargs["title"]
#self.title = data.select('Title')[0].text
except Exception as e:
config._print(e)
def get(self, key):
return self._data.get(key, None)

View File

@ -27,7 +27,7 @@
<entry>
<title>{{ entry.title }}</title>
<id>{{ entry.id }}</id>
<summary type="text">{{ entry.summary }}</summary>
m!-- <summary type="text">{{ entry.summary }}</summary> -->
{% for author in entry.authors %}
<author>
<name>{{ author }}</name>