mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix #3002 (Title can't have a colon in it)
This commit is contained in:
parent
be192a155a
commit
97c7dd07fe
@ -727,11 +727,14 @@ class Device(DeviceConfig, DevicePlugin):
|
||||
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…
x
Reference in New Issue
Block a user