always setup media; try to find media from old dropbox location

This commit is contained in:
Damien Elmes 2010-12-22 01:36:24 +09:00
parent aada2e4864
commit dcb5bf58f2

View file

@ -748,7 +748,6 @@ 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()
@ -2918,6 +2917,13 @@ 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:
# check if they were using plugin
if not prev:
p = self.dropboxFolder()
p = p.replace("/Anki", "").replace("\\Anki", "")
deck.mediaPrefix = p
migrateFrom = deck.mediaDir()
if not migrateFrom:
# find the old location # find the old location
deck.mediaPrefix = prev deck.mediaPrefix = prev
dir = deck.mediaDir() dir = deck.mediaDir()