@@ -252,7 +252,7 @@ def convert_cbz_cbr(self):
252
252
253
253
files_to_convert = [
254
254
f for f in os .listdir (self .source_dir )
255
- if f .lower ().endswith ((".cbz" , ".cbr" ))
255
+ if f .lower ().endswith ((".cbz" , ".cbr" , ".zip" )) # Include .zip files
256
256
]
257
257
258
258
for file in files_to_convert :
@@ -261,9 +261,19 @@ def convert_cbz_cbr(self):
261
261
break
262
262
263
263
old_path = os .path .join (self .source_dir , file )
264
- new_extension = ".cbr" if file .lower ().endswith (".cbz" ) else ".cbz"
264
+
265
+ # Determine the new extension
266
+ if file .lower ().endswith (".cbz" ):
267
+ new_extension = ".cbr"
268
+ elif file .lower ().endswith (".cbr" ):
269
+ new_extension = ".cbz"
270
+ elif file .lower ().endswith (".zip" ):
271
+ new_extension = ".cbz" # Convert .zip to .cbz
272
+ else :
273
+ continue
274
+
265
275
new_path = os .path .join (self .source_dir , os .path .splitext (file )[0 ] + new_extension )
266
-
276
+
267
277
try :
268
278
os .rename (old_path , new_path )
269
279
self .update_console .emit (f"Converted: { file } -> { os .path .basename (new_path )} " )
@@ -272,6 +282,7 @@ def convert_cbz_cbr(self):
272
282
273
283
self .update_console .emit ("\n File Conversion Complete!" )
274
284
285
+
275
286
class MangaProcessor (QMainWindow ):
276
287
def __init__ (self ):
277
288
super ().__init__ ()
@@ -311,8 +322,8 @@ def __init__(self):
311
322
self .reverse_process_button .clicked .connect (self .start_reverse_processing )
312
323
self .reverse_process_button .setStyleSheet ("background-color: #0066CC; color: #FFFFFF; border: none; padding: 8px 16px;" )
313
324
314
- # Convert CBZ/CBR button
315
- self .convert_button = QPushButton ("Convert CBZ/CBR" )
325
+ # Convert CBZ/CBR/ZIP button
326
+ self .convert_button = QPushButton ("Convert CBZ/CBR/ZIP " )
316
327
self .convert_button .clicked .connect (self .start_conversion )
317
328
self .convert_button .setStyleSheet ("background-color: #FF9900; color: #FFFFFF; border: none; padding: 8px 16px;" )
318
329
0 commit comments