mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	feat: remove webp on asset deleted as well (#489)
* fix(server): remove webp file on asset deleted * chore(server): job not fail when file not found
This commit is contained in:
		@@ -30,10 +30,19 @@ export class BackgroundTaskProcessor {
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      // TODO: what if there is no asset.resizePath. Should fail the Job?
 | 
			
		||||
      // => panoti report: Job not fail
 | 
			
		||||
      if (asset.resizePath) {
 | 
			
		||||
        fs.unlink(asset.resizePath, (err) => {
 | 
			
		||||
          if (err) {
 | 
			
		||||
            console.log('error deleting ', asset.originalPath);
 | 
			
		||||
            console.log('error deleting ', asset.resizePath);
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (asset.webpPath) {
 | 
			
		||||
        fs.unlink(asset.webpPath, (err) => {
 | 
			
		||||
          if (err) {
 | 
			
		||||
            console.log('error deleting ', asset.webpPath);
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user