Add file path resolution, file download methods to D-Bus API

Bug #714041 reported by Jason Gerard DeRose
6
This bug affects 1 person
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

  EnqueueDownloadFirst(_id) - if already in download queue, move to front of queue, otherwise add to front of queue

  EnqueueDownloadLast(_id) - if already in download queue, move to back of queue, otherwise add to back of queue

  DequeueDownload(_id) - remove from download queue

  ResolveFile(_id) - behaves like GetFile() but will automatically call EnqueueDownloadFirst() when file isn't available locally

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?

Tags: dbus

Related branches

Changed in dmedia:
milestone: 0.4 → 0.5
Changed in dmedia:
milestone: 0.5 → 0.6
Changed in dmedia:
milestone: 0.6 → 0.7
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

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.

Changed in dmedia:
assignee: nobody → Jason Gerard DeRose (jderose)
status: Triaged → In Progress
Changed in dmedia:
milestone: 0.7 → 0.8
Changed in dmedia:
status: In Progress → Fix Committed
Changed in dmedia:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.