Giter Site home page Giter Site logo

Comments (8)

giga avatar giga commented on May 27, 2024 1

I think it would still be dangerous to clean files if some existing files were skipped.

Imagine an import is stopped in the middle for whatever reason (power outage, disconnected drive…), one of the file may be existing but incomplete. If the user does not pay attention and blindly runs the command again, a file will be lost.

It would not seem a problem to me if cleanup were allowed only when exiftool return no error. If exiftool fails because of existing files, it would be the responsibility of the user to solve the problem (use archive and cleanup, manually cleanup, or remove existing files and run the command again).

What do you think?

from goprox.

fxstein avatar fxstein commented on May 27, 2024

Now I remember why I originally did not allow clean with import only. Had some issues with the exit status of exiftool. Need to investigate and do some testing.
Hence the exit status of exiftool is currently unchecked in all parts of goprox. Definitely needs to be addressed.

from goprox.

fxstein avatar fxstein commented on May 27, 2024

So here is the issue:

I need the ability to re-import and re-process files, sometimes all, sometimes sparse - e.g. just the missing files. When an output file already exists, exiftool throws an error and moves to the next files. These are acceptable errors as the default behavior of goprox is based on skipping existing files. However it means the error status of exiftool is no longer 0.

Other errors obviously need to get caught. Need to see if I can tell exiftool that existing target files errors are to be ignored while others are not.

from goprox.

fxstein avatar fxstein commented on May 27, 2024

That is indeed a potentially simple solution. Also still looking at some exiftool options. Will get back asap.

from goprox.

fxstein avatar fxstein commented on May 27, 2024

FYI This is why I personally always make archives that I store separately, even at the cost of a lot of extra storage, because it is the one guarantee I have to be able to re-run from scratch. Especially since developing goprox is still missing key features that I would like to apply to parts of my historic library.

But this issue needs to be addressed no matter what.

from goprox.

fxstein avatar fxstein commented on May 27, 2024

@giga Pushed the initial error handling logic as discussed. Can you test before I cut this into a new release? Thanks!

Example output when encountering one or more exiftool errors:

[2022-10-22 12:52:31] Info: Starting media import... 
[2022-10-22 12:52:31] Info: Source: /Users/xxxxx/Desktop/20221021120343_GoPro_Hero10_2826 
[2022-10-22 12:52:31] Info: Library: /Users/xxxxx/goprox-test/imported 
[2022-10-22 12:52:31] ======== /Users/xxxxx/Desktop/20221021120343_GoPro_Hero10_2826/DCIM/100GOPRO/G0030790.JPG [1/2]
[2022-10-22 12:52:31] Error: '/Users/xxxxx/goprox-test/imported/2022/20221001/20221001122745_GoPro_Hero10_2826_G0030790.JPG' already exists - /Users/xxxxx/Desktop/20221021120343_GoPro_Hero10_2826/DCIM/100GOPRO/G0030790.JPG
[2022-10-22 12:52:31] ======== /Users/xxxxx/Desktop/20221021120343_GoPro_Hero10_2826/DCIM/100GOPRO/G0030789.JPG [2/2]
[2022-10-22 12:52:31] Error: '/Users/xxxxx/goprox-test/imported/2022/20221001/20221001122735_GoPro_Hero10_2826_G0030789.JPG' already exists - /Users/xxxxx/Desktop/20221021120343_GoPro_Hero10_2826/DCIM/100GOPRO/G0030789.JPG
[2022-10-22 12:52:31] Warning: exiftool reported one or more errors. Please check output. 
[2022-10-22 12:52:31] Info: Finished media import 
[2022-10-22 12:52:31] Info: Cleaning Source Media... 
[2022-10-22 12:52:31] Info: Source: /Users/xxxxx/Desktop/20221021120343_GoPro_Hero10_2826 
[2022-10-22 12:52:31] Error: Will not clean /Users/xxxxx/Desktop/20221021120343_GoPro_Hero10_2826 due to exiftool error status: 1 
[2022-10-22 12:52:31] Error: Please check output. 

from goprox.

giga avatar giga commented on May 27, 2024

Hello,

Many thanks for the reactivity. I have this error with latest version: _clean_media:[:8: ']' expected

from goprox.

fxstein avatar fxstein commented on May 27, 2024

Could you please open a new issue and share more details?

Would be great if you could run your command with --debug and copy the output there.

Thanks!

from goprox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.