6 4
Sign in to rate

Media Sync Filter

<10kB. Updated 2020-02-21.
The author has shared 1 other item(s).

Description

This add-on can be used to optimize Anki's media sync function by filtering out syncing of media in certain conditions. Settings can be tuned in config.py. The defaults setting are listed below: settings = { 'sync_suspended_cards': False, 'sync_new_cards': False, } There are roughly two ways to use this. a) The default settings will disable syncing of media for cards that are either Suspended or New. You can use this in the scenario where you usually add and learn new cards on a single computer and then sync to AnkiWeb for review online or on a mobile device. b) In the scenario where you want to also learn New cards online or on a mobile device, but you keep your cards Suspended until you're ready to learn them, you can change settings to 'sync_suspended_cards': False, 'sync_new_cards': True. Enjoy!

Download

As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

Supported Anki versions:

To download this add-on, please copy and paste the following code into Anki 2.1:

509423518

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

All Anki 2.1.x Add-Ons

Reviews

on 1611781859
It doesn´t work. Sorry for the thumb down.
Please if you fix it it would help me a lot (my ipad is exploting with more than 5gb) :(
on 1607039814
Absolutely essential if you use subs2srs sentence banks or need space on your phone.

ATTENTION: The recent versions (around 2.1.20) have optimised the way media syncing works, (aside from the error people are getting) so it doesn't work. That said, in the recent versions you can sync without syncing media, so personally I just sync the cards with 2.1.35, and I use 2.1.15 to do some daily tasks and at that time I also sync the media.
on 1606942805
As others mentioned, it does not work. Hope the author sees this :(

An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.

When loading '⁨Media Sync Filter⁩':
⁨Traceback (most recent call last):
File "aqt/addons.py", line 208, in loadAddons
File "/home/user/.local/share/Anki2/addons21/509423518/__init__.py", line 18, in <module>
media.MediaManager._changed = wrap(media.MediaManager._changed, my_media_changed, 'around')
AttributeError: type object 'MediaManager' has no attribute '_changed'
on 1602107742
I can't get the addon to work. Here's the error message:

An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.

When loading '⁨Media Sync Filter⁩':
⁨Traceback (most recent call last):
File "aqt\addons.py", line 208, in loadAddons
File "C:\Users\test\AppData\Roaming\Anki2\addons21\509423518\__init__.py", line 18, in <module>
media.MediaManager._changed = wrap(media.MediaManager._changed, my_media_changed, 'around')
AttributeError: type object 'MediaManager' has no attribute '_changed'
on 1594969993
This addon is absolutely amazing and completely essential for those who have large sentence banks, but like to do their daily reps on their phones. It works perfectly with morphman and allows me to keep a large sentence bank on my computer without over crowding other devices.
on 1594054639
Apologies for the downvote, but you don't have a contact author button to use. I cannot get the addon to run. Error below:

An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.

When loading '⁨Media Sync Filter⁩':
⁨Traceback (most recent call last):
File "aqt\addons.py", line 208, in loadAddons
File "C:\Users\[user]\AppData\Roaming\Anki2\addons21\509423518\__init__.py", line 18, in <module>
media.MediaManager._changed = wrap(media.MediaManager._changed, my_media_changed, 'around')
AttributeError: type object 'MediaManager' has no attribute '_changed'
on 1588503979
Awesome, thanks for sharing this! I was already in the need of something like this half a year ago, but I found nothing and didn't know how to develop it myself. With my humongous sentence bank (having all potentially useful sentences from all my favourite shows and movies available) becoming less and less easier to handle, I was just about trying to figure it out on my own. Thank you so much for saving me the hassle of doing that! By changing the "query for media to actually synchronize" in media_filter.py (line 34), I could also define the exact behaviour that I wanted. (Only exclude cards from one deck if they are new and not immediately learnable.) My new query looks like this:
"select notes.id, notes.mid, notes.flds from cards, notes where cards.nid = notes.id"
" and (not cards.did = 1 or cards.reps > 0 or notes.tags like '%Ease::i+1%')"
In my collection, immediately learnable cards have the tag Ease::i+1 attached to them. It happens that the deck ID (cards.did) of the deck that I want to exclude is 1, you can find out the IDs of any other decks in the "decks" column of the "con" table of your collection database.
on 1582810165
Very useful when dealing with large sentence banks, great job.
on 1582361178
This helped me to reduce the size of my media folder and now I can easily keep a sentence bank without overwhelming my android device.
on 1582285960
This addon is awesome!