compare NFD normalized paths
This commit is contained in:
parent
3cd63695c4
commit
74586d7164
2 changed files with 5 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ import os
|
|||
import shutil
|
||||
import stat
|
||||
import time
|
||||
import unicodedata
|
||||
|
||||
import ox
|
||||
|
||||
|
|
@ -31,6 +32,7 @@ def remove_missing(books=None):
|
|||
prefix = get_prefix()
|
||||
if books is None:
|
||||
books = collect_books(prefix)
|
||||
books = [unicodedata.normalize('NFD', path) for path in books]
|
||||
with db.session():
|
||||
if os.path.exists(prefix):
|
||||
logger.debug('scan for removed files')
|
||||
|
|
@ -40,6 +42,8 @@ def remove_missing(books=None):
|
|||
if state.shutdown:
|
||||
return
|
||||
path = f.fullpath()
|
||||
path = unicode
|
||||
path = unicodedata.normalize('NFD', path)
|
||||
db_paths.append(path)
|
||||
if f.item:
|
||||
items[path] = f.sha1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue