(library_path)
| 156 | |
| 157 | |
| 158 | def 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 | |
| 181 | def rescan_photo_libraries(paths=[]): |
no test coverage detected