Importing .apkg deck with media included problem

193 views
Skip to first unread message

voxe...@gmail.com

unread,
Jun 17, 2015, 9:26:18 AM6/17/15
to anki-a...@googlegroups.com, dorm...@mail.ru
Hello!

I've got a problem (still exists in 2.5alpha39) - apkg decks with media included will import without them if a subfolder for media files is used.
1. Inside .apkg archive there are
1.a. collection.anki2 file - works
1.b. media file: - ERROR
{"344": "irreg_vrb/drink.jpg", "0": "irreg_vrb/flee.jpg",
1.c. 0...NNNN files (renamed from original, see 1.b)

2. If I create manually folder AnkiDroid/collection.media/irreg_vrb
    it will be filled with all the files from .apkg package and everything is OK
3. If I dont create folder AnkiDroid/collection.media/irreg_vrb and it doesn't exist than Import will not create it automatically and all media files will not be unpacked at all!

Is this a bug (i.e. irreg_vbr from example above shoud be created automatically, but for some reasons it doesn't) or this is a feature and the only way is to
* import deck
* open it
* see empty placeholders and silent play-buttons
* edit any card and notice [sound:irreg_vrb/file.mp3] record inside
* open ES File Explorer
* navigate to AnkiDroid/collection.media folder
* create directory "irreg_vrb"
* switch back to AnkiDroid
* delete deck "Irregular verbs"
* reimport .apkg file
Enjoy the deck?

--
  WBRegards, Dormouse.

Tim

unread,
Jun 17, 2015, 9:28:32 AM6/17/15
to anki-a...@googlegroups.com, voxe...@gmail.com, voxe...@gmail.com, dorm...@mail.ru
Subfolders are not supported by Anki sorry

voxe...@gmail.com

unread,
Jun 17, 2015, 9:42:26 AM6/17/15
to anki-a...@googlegroups.com, dorm...@mail.ru, voxe...@gmail.com
Actually THEY ARE SUPPORTED!
All files from .apkg package extract automatically to collection.media/subfoldername If I create subfoldername manually. After that everything works fine - sounds play and images show! So all media successfully copied and extracted where expected - to collection.media/subfolder !

Please, check importing code near the string like "cp digit_name collection.media/new_name" and modify it to something like before copying

if m=re.search('(.*)/(.*)', new_name):
 mkdir m.group(0)

Tim

unread,
Jun 17, 2015, 10:44:56 AM6/17/15
to anki-a...@googlegroups.com, voxe...@gmail.com, voxe...@gmail.com, dorm...@mail.ru
Thanks, can you send a pull request?
Reply all
Reply to author
Forward
0 new messages