File tree 2 files changed +16
-12
lines changed
2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 1
- 1.0.0-develop3
1
+ 1.0.0-develop4
Original file line number Diff line number Diff line change @@ -249,18 +249,22 @@ def get_resources(media):
249
249
local_path = Path (meta_dirs [item .type ]) / guid_hash [0 ] / f"{ guid_hash [1 :]} .bundle" / "Uploads" / resource_path
250
250
source_path = meta_dir / local_path
251
251
252
- section_images += 1
253
- total_size += source_path .stat ().st_size
254
- if mode == "move" :
255
- destination_path = restore_dir / local_path .with_suffix (".jpg" )
256
- msg = f"MOVE: { source_path } --> { destination_path } "
257
- destination_path .parent .mkdir (parents = True , exist_ok = True )
258
- source_path .rename (destination_path )
259
- elif mode == "remove" :
260
- msg = f"REMOVE: { source_path } "
261
- source_path .unlink ()
252
+ if source_path .exists ():
253
+ section_images += 1
254
+ total_size += source_path .stat ().st_size
255
+ if mode == "move" :
256
+ destination_path = restore_dir / local_path .with_suffix (".jpg" )
257
+ msg = f"MOVE: { source_path } --> { destination_path } "
258
+ destination_path .parent .mkdir (parents = True , exist_ok = True )
259
+ source_path .rename (destination_path )
260
+ elif mode == "remove" :
261
+ msg = f"REMOVE: { source_path } "
262
+ source_path .unlink ()
263
+ else :
264
+ msg = f"BLOAT FILE: { source_path } "
262
265
else :
263
- msg = f"BLOAT FILE: { source_path } "
266
+ msg = f"BLOAT FILE NOT FOUND: { source_path } "
267
+
264
268
if mode == "report" :
265
269
logger .debug (msg )
266
270
else :
You can’t perform that action at this time.
0 commit comments