server_utils test helper works with non-expose media db

This commit is contained in:
Karsten Lehmann 2020-08-28 20:07:22 +02:00
parent c5bce6282f
commit 5f17eb7db9
No known key found for this signature in database
GPG Key ID: 6C34E8199743C270

View File

@ -86,5 +86,6 @@ def add_files_to_server_mediadb(media, filepaths):
with open(os.path.join(media.dir(), fname), 'wb') as f:
f.write(data)
media.db.execute("INSERT INTO media VALUES (?, ?, ?)", fname, media.lastUsn() + 1, csum)
media.db.commit()
media.addMedia(
((fname, media.lastUsn() + 1, csum),)
)