Add file path resolution, file download methods to D-Bus API
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Dmedia |
Fix Released
|
High
|
Jason Gerard DeRose |
Bug Description
The goal is to provide apps a very simple D-Bus API and to expose as little of the dmedia internals as possible (so those internals can change without breaking apps). In the near future, apps with dmedia integration will likely include Novacut, PiTiVi, and Shotwell.
The application will have the document _id of a file, and using that _id will need to:
1. Find out if the file is available locally
2. Get the full filesystem path of the file (when available locally)
3. Enqueue the file for download (when needed locally)
4. Dequeue the file from the download queue
To address these needs, I'm proposing the following D-Bus API:
HasFile(_id) - returns True if file is available locally, otherwise False
GetFile(_id) - returns full filesystem path of file if available locally, otherwise raises FileUnavailable
EnqueueDownlo
EnqueueDownlo
DequeueDownlo
ResolveFile(_id) - behaves like GetFile() but will automatically call EnqueueDownload
If any of the above methods are called with an _id that is *not* present in the dmedia library, UnknownFile is raised.
Or something basically like this. Thoughts?
Related branches
- dmedia Dev: Pending requested
-
Diff: 454 lines (+218/-100)4 files modifieddmedia-cli (+66/-86)
dmedia/core.py (+49/-11)
dmedia/service/__init__.py (+16/-0)
dmedia/tests/test_core.py (+87/-3)
Changed in dmedia: | |
milestone: | 0.4 → 0.5 |
Changed in dmedia: | |
milestone: | 0.5 → 0.6 |
Changed in dmedia: | |
milestone: | 0.6 → 0.7 |
Changed in dmedia: | |
milestone: | 0.7 → 0.8 |
Changed in dmedia: | |
status: | In Progress → Fix Committed |
Changed in dmedia: | |
status: | Fix Committed → Fix Released |
Okay, I'm getting started on this. In addition to the above methods, I'm also going to add at least:
AddFileStore( directory)
The equivalent method will be added to dmedia.core.Core as well. In terms of usage, for example:
AddFileStore( '/home' )
Would add a new filestore in /home/.dmedia.