Allow import based upon general file types.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Dmedia |
Fix Released
|
High
|
David Green |
Bug Description
Currently dmedia requires that specific file extensions be specified for import. It would be good if there was an option to import all files of a general type, such as 'image', 'audio' and 'video'. There could also be a 'media' type that matches all files of type 'image', 'audio' or 'video'. This would be especially useful for automatic imports from devices - all 'media' files could be imported. The 'media' type would also be useful as a default option for the importer.
There are 2 ways I can see to implement this:
1) use the mime types of files to get the general type. Mime types use the following format 'general/specific'. eg. 'photo.jpg' would have the mime type 'image/jpeg' and from that the general 'image' type could be extracted.
2) maintain a list of file extensions corresponding to each general type.
Related branches
- Jason Gerard DeRose: Approve
-
Diff: 60 lines (+21/-14)1 file modifieddmedialib/constants.py (+21/-14)
- dmedia Dev: Pending requested
-
Diff: 137 lines (+47/-13)2 files modifieddmedia (+26/-6)
dmedia.1 (+21/-7)
Changed in dmedia: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in dmedia: | |
milestone: | none → 0.2 |
Changed in dmedia: | |
status: | Fix Committed → Fix Released |
Hehe... I was actually just thinking about this, and am working on it in lp:~jderose/dmedia/get-on-da-bus
I think you're exactly right that we generally want to import based high-level types like 'video', 'audio', 'image'.
So I'll add this to the dbus API... import based on an explicit set of extensions, or based on high-level types. And then I'll update the dmedia script to talk to the dmedia session daemon over dbus.
Right now I'm focusing on getting the import process right for importing from memory cards, where it's fairly safe to assume that files will have correct canonical file extensions. Building the list of files to consider based on file extension is super fast.
Down the road we could also support more sophisticated type detection by inspecting the file contents. Help when file extensions aren't correct or are missing, but is also much slower.
Did you want to work on any of this, David? I'm adding this to the dbus API right now, but if you wanted to add the correct args/options to the dmedia script, have at it!