mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
option to avoid media dir creation
This commit is contained in:
parent
7a0f18d2c7
commit
af97497747
2 changed files with 4 additions and 2 deletions
|
@ -45,7 +45,7 @@ class _Collection(object):
|
|||
self.server = server
|
||||
self._lastSave = time.time()
|
||||
self.clearUndo()
|
||||
self.media = MediaManager(self)
|
||||
self.media = MediaManager(self, server)
|
||||
self.models = ModelManager(self)
|
||||
self.decks = DeckManager(self)
|
||||
self.tags = TagManager(self)
|
||||
|
|
|
@ -17,8 +17,10 @@ class MediaManager(object):
|
|||
regexps = ("(?i)(\[sound:([^]]+)\])",
|
||||
"(?i)(<img[^>]+src=[\"']?([^\"'>]+)[\"']?[^>]*>)")
|
||||
|
||||
def __init__(self, col):
|
||||
def __init__(self, col, server):
|
||||
self.col = col
|
||||
if server:
|
||||
return
|
||||
# media directory
|
||||
self._dir = re.sub("(?i)\.(anki2)$", ".media", self.col.path)
|
||||
# convert dir to unicode if it's not already
|
||||
|
|
Loading…
Reference in a new issue