This page exists to document what all needs to be done in order to fix the Removable Media Handling in Nepomuk.
The consensus ( Sebastian and Vishesh ) was that files which exist on a removable media should have a nie:url of the form 'filex://<UUID>/<relative-path>'. These resource will have this special filex url from the start.
This is different that what is currently done - Currently every time the device is unmounted the nie:url is changed from 'file:/' to 'filex://uuid/path'. This is done by the removable storage service.
For network shares we use the NFS or Samba host + path in a URL with nfs:/ or smb:/ schema. This URL is provided by the new Solid::NetworkShare interface.
- For optical media we have several possible identifier which might also be combined:
- The filesystem label (Problem: far from being unique)
- The DVD/BD media id (Problem: only available on writable DVD and BD media and not provided by Solid)
For now we use the filesystem label which is not great at all.
- [DONE] Create a new RemovableMediaModel which is layered below the DataManagementModel and automatically converts file: to filex URLs and vice-versa. That way clients (including DataManagementModel) do not have to care about filex: but simply always use file: to access files. The only exception are files on media that are not mounted at the moment. Thus, clients can check for filex: URLs and know that these files are not accessible at the moment.
- Let the filewatch service monitor removable media itself. Whenever a media is mounted it does two things:
- [DONE] Install inotify watches for the mount point
- [DONE] Run the invalid file thread on the mount point to remove any file resources referring to files that were removed from the medium while it was not mounted. This means the invalid file resources thread needs to be parameterised with the base path.
- [DONE] The removable storage service will be removed. It's code is split between the RemovableMediaModel and the filewatch service.
- FIXME: the relation between the parent folder of the mount point and the root folder of the mounted file-system is a problem.
Nice Side Effects
- Filewatch will not remove files from unmounted media anymore since their URLs are not translated from filex: into file: and, thus, the invalid file resource thread will simply not find them.
- [IN PROGRESS] Have a config dialog that allows to manage removable media which have annotations in Nepomuk (this includes indexed files). The dialog could look something like the KDE auto-mounting dialog and allow to completely remove any data related to the medium, export it, and enable/disable file indexing for the medium.