@ -306,22 +306,22 @@ def upload():
helper . add_book_to_thumbnail_cache ( book_id )
helper . add_book_to_thumbnail_cache ( book_id )
book_format_from = meta . extension . upper ( ) [ 1 : ]
book_format_from = meta . extension . upper ( ) [ 1 : ]
if (
if ( config . config_auto_convert_to_formats ) :
config . config_auto_convert_to_format and
for format in config . config_auto_convert_to_format s. split ( ' , ' ) :
config . config_auto_convert_to_format . upper ( ) != book_format_from
book_format_to = format . strip ( ) . upper ( )
) :
if book_format_to == book_format_from :
book_format_to = config . config_auto_convert_to_format . upper ( )
continue
rtn = helper . convert_book_format ( book_id ,
rtn = helper . convert_book_format ( book_id ,
config . get_book_path ( ) ,
config . get_book_path ( ) ,
book_format_from ,
book_format_from ,
book_format_to ,
book_format_to ,
current_user . name )
current_user . name )
if rtn is None :
if rtn is None :
flash ( _ ( " Book successfully queued for converting to %(book_format)s " ,
flash ( _ ( " Book successfully queued for converting to %(book_format)s " ,
book_format = book_format_to ) ,
book_format = book_format_to ) ,
category = " success " )
category = " success " )
else :
else :
flash ( _ ( " There was an error converting this book: %(res)s " , res = rtn ) , category = " error " )
flash ( _ ( " There was an error converting this book: %(res)s " , res = rtn ) , category = " error " )
if len ( request . files . getlist ( " btn-upload " ) ) < 2 :
if len ( request . files . getlist ( " btn-upload " ) ) < 2 :
if current_user . role_edit ( ) or current_user . role_admin ( ) :
if current_user . role_edit ( ) or current_user . role_admin ( ) :