Archived
feat: pdf reader
This commit is contained in:
@@ -91,13 +91,15 @@ class EBookListSerializer(serializers.ModelSerializer):
|
||||
return None
|
||||
|
||||
def get_started(self, obj):
|
||||
"""True when the user has opened the reader and has a saved EPUB location."""
|
||||
"""True when the user has opened the reader with saved progress."""
|
||||
try:
|
||||
rp = obj.reading_progress
|
||||
except ReadingProgress.DoesNotExist:
|
||||
return False
|
||||
if rp.current_position >= 99:
|
||||
return False
|
||||
if obj.format == "pdf":
|
||||
return rp.last_page > 0 or rp.current_position > 0
|
||||
return bool((rp.epub_location or "").strip())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user