MCPcopy
hub / github.com/photonixapp/photonix / import_photos_in_place

Function import_photos_in_place

photonix/photos/utils/organise.py:158–178  ·  view source on GitHub ↗
(library_path)

Source from the content-addressed store, hash-verified

156
157
158def import_photos_in_place(library_path):
159 orig = library_path.path
160 imported = 0
161 were_bad = 0
162
163 for r, d, f in os.walk(orig):
164 if SYNOLOGY_THUMBNAILS_DIR_NAME in r:
165 continue
166 for fn in sorted(f):
167 filepath = os.path.join(r, fn)
168 if blacklisted_type(fn):
169 # Blacklisted type
170 were_bad += 1
171 else:
172 modified = record_photo(filepath, library_path.library)
173 if modified:
174 imported += 1
175 print('IMPORTED {}'.format(filepath))
176
177 if imported:
178 print('\n{} PHOTOS IMPORTED\n{} WERE BAD'.format(imported, were_bad))
179
180
181def rescan_photo_libraries(paths=[]):

Callers 2

rescanMethod · 0.90
rescan_photosFunction · 0.90

Calls 2

record_photoFunction · 0.90
blacklisted_typeFunction · 0.85

Tested by

no test coverage detected