mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-10-31 18:47:02 -04:00 
			
		
		
		
	Change date in XML database to reflect the 505's broken behavior. This keeps it from regenrating the entries, thereby preserving uploaded metadata.
This commit is contained in:
		
							parent
							
								
									85718558aa
								
							
						
					
					
						commit
						441eb8f3da
					
				| @ -35,8 +35,8 @@ def strptime(src): | |||||||
|     src[2] = str(MONTH_MAP[src[2]]) |     src[2] = str(MONTH_MAP[src[2]]) | ||||||
|     return time.strptime(' '.join(src), '%w, %d %m %Y %H:%M:%S %Z') |     return time.strptime(' '.join(src), '%w, %d %m %Y %H:%M:%S %Z') | ||||||
| 
 | 
 | ||||||
| def strftime(epoch): | def strftime(epoch, zone=time.gmtime): | ||||||
|     src = time.strftime("%w, %d %m %Y %H:%M:%S GMT", time.gmtime(epoch)).split() |     src = time.strftime("%w, %d %m %Y %H:%M:%S GMT", zone(epoch)).split() | ||||||
|     src[0] = INVERSE_DAY_MAP[int(src[0][:-1])]+',' |     src[0] = INVERSE_DAY_MAP[int(src[0][:-1])]+',' | ||||||
|     src[2] = INVERSE_MONTH_MAP[int(src[2])] |     src[2] = INVERSE_MONTH_MAP[int(src[2])] | ||||||
|     return ' '.join(src) |     return ' '.join(src) | ||||||
| @ -14,7 +14,7 @@ | |||||||
| ##    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ##    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||||||
| ''' | ''' | ||||||
| ''' | ''' | ||||||
| import re | import re, time, functools | ||||||
| from uuid import uuid4 as _uuid | from uuid import uuid4 as _uuid | ||||||
| import xml.dom.minidom as dom | import xml.dom.minidom as dom | ||||||
| from base64 import b64decode as decode | from base64 import b64decode as decode | ||||||
| @ -22,7 +22,10 @@ from base64 import b64encode as encode | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| from libprs500.devices.interface import BookList as _BookList | from libprs500.devices.interface import BookList as _BookList | ||||||
| from libprs500.devices import strftime, strptime | from libprs500.devices import strftime as _strftime | ||||||
|  | from libprs500.devices import strptime | ||||||
|  | 
 | ||||||
|  | strftime = functools.partial(_strftime, zone=time.localtime) | ||||||
| 
 | 
 | ||||||
| MIME_MAP   = {  | MIME_MAP   = {  | ||||||
|                 "lrf" : "application/x-sony-bbeb",  |                 "lrf" : "application/x-sony-bbeb",  | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user