[books] Add bookmark_url to logdata
This commit is contained in:
@ -62,6 +62,7 @@ class BookLogData(BaseLogData, LongPlayLogData):
|
|||||||
pages_read: Optional[int] = None
|
pages_read: Optional[int] = None
|
||||||
page_start: Optional[int] = None
|
page_start: Optional[int] = None
|
||||||
page_end: Optional[int] = None
|
page_end: Optional[int] = None
|
||||||
|
bookmark_url: Optional[str] = None
|
||||||
|
|
||||||
_excluded_fields = {"koreader_hash", "page_data"}
|
_excluded_fields = {"koreader_hash", "page_data"}
|
||||||
|
|
||||||
|
|||||||
@ -260,8 +260,10 @@ def manual_scrobble_book(
|
|||||||
log = {}
|
log = {}
|
||||||
source = "Vrobbler"
|
source = "Vrobbler"
|
||||||
page = None
|
page = None
|
||||||
|
url = None
|
||||||
|
|
||||||
if READCOMICSONLINE_URL in title:
|
if READCOMICSONLINE_URL in title:
|
||||||
|
url = title
|
||||||
title, volume, page = parse_readcomicsonline_uri(title)
|
title, volume, page = parse_readcomicsonline_uri(title)
|
||||||
if not title:
|
if not title:
|
||||||
logger.info(
|
logger.info(
|
||||||
@ -309,6 +311,9 @@ def manual_scrobble_book(
|
|||||||
scrobble = Scrobble.create_or_update(book, user_id, scrobble_dict, read_log_page=page)
|
scrobble = Scrobble.create_or_update(book, user_id, scrobble_dict, read_log_page=page)
|
||||||
|
|
||||||
if action == "stop":
|
if action == "stop":
|
||||||
|
if url:
|
||||||
|
scrobble.log["bookmark_url"] = url
|
||||||
|
scrobble.save(update_fields=["log"])
|
||||||
scrobble.stop(force_finish=True)
|
scrobble.stop(force_finish=True)
|
||||||
|
|
||||||
return scrobble
|
return scrobble
|
||||||
|
|||||||
@ -27,6 +27,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<p>{{scrobbles.count}} scrobbles</p>
|
<p>{{scrobbles.count}} scrobbles</p>
|
||||||
|
{% for s in scrobbles %}
|
||||||
|
{% if forloop.first %}
|
||||||
|
<p><a href="{{s.logdata.bookmark_url}}">Resume</a></p>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md">
|
<div class="col-md">
|
||||||
|
|||||||
Reference in New Issue
Block a user