Issue 1501: Close media database after importing.#76
Merged
flerda merged 1 commit intoankidroid:v2.1-devfrom Jul 7, 2013
hssm:Issue1501
Merged
Issue 1501: Close media database after importing.#76flerda merged 1 commit intoankidroid:v2.1-devfrom hssm:Issue1501
flerda merged 1 commit intoankidroid:v2.1-devfrom
hssm:Issue1501
Conversation
Member
There was a problem hiding this comment.
Is this intentional? It undoes your previous change.
Member
There was a problem hiding this comment.
I get it. This is meant to be the right fix, i.e., we no longer need to create multiple output directories, since now we class all the files in it, and delete will work!
Nice work!
flerda
added a commit
that referenced
this pull request
Jul 7, 2013
Issue 1501: Close media database after importing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue 1501 again. It was going to haunt me until I figured it out.
mSrcis the collection we are importing. Notice, however, that the collection itself isn't closed in the normal way. We're directly closing its database. This, however, means that the media database in the collection is still left open.To be honest, I don't understand why we aren't closing it with Collection.close. Why do we need to need to keep the "count" (which is actually in AnkiDatabaseManager, contrary to the comment) of this database? Haven't we finished using it? I'm not sure what the implications of changing this are, so I've left it as-in and just closed the media database as well later down when we've finished importing media.