mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
always setup media; try to find media from old dropbox location
This commit is contained in:
parent
aada2e4864
commit
dcb5bf58f2
1 changed files with 14 additions and 8 deletions
|
@ -748,8 +748,7 @@ Debug info:\n%s""") % traceback.format_exc(), help="DeckErrors")
|
||||||
and self.deck.syncName):
|
and self.deck.syncName):
|
||||||
if self.syncDeck(interactive=False):
|
if self.syncDeck(interactive=False):
|
||||||
return True
|
return True
|
||||||
if interactive:
|
self.setupMedia(self.deck)
|
||||||
self.setupMedia(self.deck)
|
|
||||||
try:
|
try:
|
||||||
self.deck.initUndo()
|
self.deck.initUndo()
|
||||||
self.moveToState("initial")
|
self.moveToState("initial")
|
||||||
|
@ -2918,12 +2917,19 @@ to work with this version of Anki."""))
|
||||||
# check if the media has moved
|
# check if the media has moved
|
||||||
migrateFrom = None
|
migrateFrom = None
|
||||||
if prev != next:
|
if prev != next:
|
||||||
# find the old location
|
# check if they were using plugin
|
||||||
deck.mediaPrefix = prev
|
if not prev:
|
||||||
dir = deck.mediaDir()
|
p = self.dropboxFolder()
|
||||||
if dir and os.listdir(dir):
|
p = p.replace("/Anki", "").replace("\\Anki", "")
|
||||||
# it contains files; we'll need to migrate
|
deck.mediaPrefix = p
|
||||||
migrateFrom = dir
|
migrateFrom = deck.mediaDir()
|
||||||
|
if not migrateFrom:
|
||||||
|
# find the old location
|
||||||
|
deck.mediaPrefix = prev
|
||||||
|
dir = deck.mediaDir()
|
||||||
|
if dir and os.listdir(dir):
|
||||||
|
# it contains files; we'll need to migrate
|
||||||
|
migrateFrom = dir
|
||||||
# setup new folder
|
# setup new folder
|
||||||
deck.mediaPrefix = next
|
deck.mediaPrefix = next
|
||||||
if migrateFrom:
|
if migrateFrom:
|
||||||
|
|
Loading…
Reference in a new issue