mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-21 19:46:04 +01:00
Fix #3002 (Title can't have a colon in it)
This commit is contained in:
parent
be192a155a
commit
97c7dd07fe
2 changed files with 7 additions and 1 deletions
|
|
@ -727,11 +727,14 @@ def create_upload_path(self, path, mdata, fname):
|
|||
if r.startswith('.'): r = x[0]+r
|
||||
else:
|
||||
r = x[:-delta]
|
||||
r = r.strip()
|
||||
if not r:
|
||||
r = x.strip()[0] if x.strip() else 'x'
|
||||
if x is resizable[-1]:
|
||||
filepath = filepath.replace(os.sep+x, os.sep+r)
|
||||
else:
|
||||
filepath = filepath.replace(os.sep+x+os.sep, os.sep+r+os.sep)
|
||||
filepath = filepath.replace(os.sep+os.sep, os.sep)
|
||||
filepath = filepath.replace(os.sep+os.sep, os.sep).strip()
|
||||
newpath = os.path.dirname(filepath)
|
||||
|
||||
if not os.path.exists(newpath):
|
||||
|
|
|
|||
|
|
@ -54,6 +54,9 @@ def shorten_components_to(length, components):
|
|||
if r.startswith('.'): r = x[0]+r
|
||||
else:
|
||||
r = x[:-delta]
|
||||
r = r.strip()
|
||||
if not r:
|
||||
r = x.strip()[0] if x.strip() else 'x'
|
||||
ans.append(r)
|
||||
return ans
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue