Allow download of archived books
This commit is contained in:
		
							parent
							
								
									f4096b136e
								
							
						
					
					
						commit
						91a21ababe
					
				| 
						 | 
				
			
			@ -823,7 +823,7 @@ def get_cc_columns(filter_config_custom_read=False):
 | 
			
		|||
 | 
			
		||||
def get_download_link(book_id, book_format, client):
 | 
			
		||||
    book_format = book_format.split(".")[0]
 | 
			
		||||
    book = calibre_db.get_filtered_book(book_id)
 | 
			
		||||
    book = calibre_db.get_filtered_book(book_id, allow_show_archived=True)
 | 
			
		||||
    if book:
 | 
			
		||||
        data1 = calibre_db.get_book_format(book.id, book_format.upper())
 | 
			
		||||
    else:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										19
									
								
								cps/kobo.py
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								cps/kobo.py
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -355,7 +355,9 @@ def HandleMetadataRequest(book_uuid):
 | 
			
		|||
        return redirect_or_proxy_request()
 | 
			
		||||
 | 
			
		||||
    metadata = get_metadata(book)
 | 
			
		||||
    return jsonify([metadata])
 | 
			
		||||
    response = make_response(json.dumps([metadata]))
 | 
			
		||||
    response.headers["Content-Type"] = "application/json; charset=utf-8"
 | 
			
		||||
    return response
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def get_download_url_for_book(book, book_format):
 | 
			
		||||
| 
						 | 
				
			
			@ -413,15 +415,12 @@ def get_description(book):
 | 
			
		|||
def get_author(book):
 | 
			
		||||
    if not book.authors:
 | 
			
		||||
        return {"Contributors": None}
 | 
			
		||||
    if len(book.authors) > 1:
 | 
			
		||||
        author_list = []
 | 
			
		||||
        autor_roles = []
 | 
			
		||||
        for author in book.authors:
 | 
			
		||||
            autor_roles.append({"Name":author.name})    #.encode('unicode-escape').decode('latin-1')
 | 
			
		||||
            author_list.append(author.name)
 | 
			
		||||
        return {"ContributorRoles": autor_roles, "Contributors":author_list}
 | 
			
		||||
    return {"ContributorRoles": [{"Name":book.authors[0].name}],
 | 
			
		||||
            "Contributors": book.authors[0].name}
 | 
			
		||||
    author_list = []
 | 
			
		||||
    autor_roles = []
 | 
			
		||||
    for author in book.authors:
 | 
			
		||||
        autor_roles.append({"Name":author.name})    #.encode('unicode-escape').decode('latin-1')
 | 
			
		||||
        author_list.append(author.name)
 | 
			
		||||
    return {"ContributorRoles": autor_roles, "Contributors":author_list}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def get_publisher(book):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -182,10 +182,9 @@ class SyncToken:
 | 
			
		|||
        return b64encode_json(token)
 | 
			
		||||
 | 
			
		||||
    def __str__(self):
 | 
			
		||||
        return "{},{},{},{},{},{}".format(self.raw_kobo_store_token,
 | 
			
		||||
                                       self.books_last_created,
 | 
			
		||||
        return "{},{},{},{},{},{}".format(self.books_last_created,
 | 
			
		||||
                                       self.books_last_modified,
 | 
			
		||||
                                       self.archive_last_modified,
 | 
			
		||||
                                       self.reading_state_last_modified,
 | 
			
		||||
                                       self.tags_last_modified)
 | 
			
		||||
                                       self.tags_last_modified, self.raw_kobo_store_token)
 | 
			
		||||
                                       #self.books_last_id)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user