Comments (7)
so, in filesystem.py
, there's a method process_checksum()
. This method is supposed to return the checksum of the file to import, but can return None as well. If the file being imported already exists in the destination folder and has the same checksum, this method returns None.
The caller of this method is another method, process_file()
, as pasted below
checksum = self.process_checksum(_file, allow_duplicate)
if(checksum is None):
log.info('Original checksum returned None for %s. Skipping...' %
_file)
return
This is all fine, we should skip the file if it has already been imported. However, it ends up reporting that file as having encountered an error on import, when this is not actually the case. It should either report that it was successfully imported, or that it was not imported because it already existed, not "error".
from elodie.
to continue the comment above,
The import()
method in elodie.py
calls process_file()
, and this is supposed to return the destination path as well, but will return None if process_file()
returned None, which is the case when the file to be imported has already been imported.
The import_file()
method is called in the _import()
method. When the destination path is None
, _import()
will make has_errors
equal to True
:
for current_file in files:
dest_path = import_file(current_file, destination, album_from_folder,
trash, allow_duplicates)
result.append((current_file, dest_path))
has_errors = has_errors is True or not dest_path
Which on the following lines causes the program to exit:
if has_errors:
sys.exit(1)
from elodie.
ah, here it is. Just before the sys.exit(1)
call, a Result
object is used to write the error output to the command line. When a result with destination None
is appended to the Result object, it is saved as being an "error". Then when the results are printed to the command line, it reports these files that have previously been imported, as being errors.
from elodie.
A potential solution to this issue is to add a "class" of results in the Result object. Instead of only having "success" and "error", we could also have a "duplicate" or "already_existed" variable to keep track of files that weren't imported due to already existing in the destination folder. This way it would not be reported as an error, but rather a duplicate file that has not been imported again.
from elodie.
I am working on this issue in my fork of Elodie.
I have encountered something that I don't understand. There are some log.info() calls that print nothing when the debug option is enabled. Expected behavior is that it prints the info message, as other log.info() calls do.
Example in filesystem.py
:
print("TEST!!!")
log.info('%s already at %s.' % (
_file,
checksum_file
))
my print works, but log.info prints nothing with debug enabled, which is not what is expected
from elodie.
nevermind on that log.info thing. I'm just blind apparently
from elodie.
I believe I have fixed this issue to my satisfaction. See: this commit
from elodie.
Related Issues (20)
- api key generation fails HOT 3
- keywords based dynamic albums HOT 1
- imghdr going away
- Crash on text file NOT containing us-ascii or utf-8 in first line
- feature: able to create symlinks instead of copying
- Calculate checksum of image without EXIF-data
- Unknown Location - invalid AppKey HOT 14
- Support a time offset in addition to absolute time
- ISO 8601 datetime without capitalising the rest of the filename? HOT 1
- Dockerfile no longer resolves to a valid url for Exiftool download
- Dockerfile no longer works with debian:jessie as the base
- Unexpected int returned instead of string from metadata[part] in filesystem.py HOT 1
- Will there be an official Elodie docker image published on the cloud (ie not the Dockerfile) ?
- Elodie not recognizing videos with the .mkv file extension HOT 2
- Feature request: support for NRW and RAF files HOT 1
- config.ini ignored HOT 5
- Need to add a test: adding a file which is already in destination
- CircleCI URL for exiftool returns 404
- Use local database for geolocation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elodie.