Improve file tracking in the resume point cache

Issue #538 resolved
prl created an issue

When a recording or media file is moved in the media player, its cache entry deleted. Similarly for directory contents when a directory is moved.

Allow the media player to update file locations in the resume point cache so that files keep their resume points after moving, including after moving into and out of Trash.

Possibly also copy the resume points when files/recordings/directories are copied.

Comments (1)

  1. Peter Urbanec

    Fix issue #538: Improve file tracking in the resume point cache

    [InfoBarGenerics]

    Add function renameResumePoint() to rename or copy resume point cache entries for media files, recordings or directories moved or copied by the media player.

    [MovieSelection]

    Put the extra mappings between extensions and service types into a variable so that they can be reused. Change the comments on the mapping strings so that they say something useful.

    Add calls to InfoBarGenerics.renameResumePoint() to moveServiceFiles() and copyServiceFiles().

    Add function findMatchingServiceRefs() that maps filenames to their respective servicerefs. The files/directories must exist to be converted into servicerefs.

    Add local function __convertFilenameToServiceref() to convert a single file/directory path into its serviceref.

    The combination of the above means that when InfoBarInstantRecord.moveToTrash() calls moveServiceFiles(), the resume point for therecording is correctly handled.

    Use __convertFilenameToServiceref() in moveServiceFiles() and copyServiceFiles() so that resume point renaming/copying works for both servicerefs and file paths.

    Remove calls to InfoBarGenerics.delResumePoint() where files/recordings/directories are moved rather than deleted (including being moved to Trash) because an appropriate call of InfoBarGenerics.renameResumePoint() is made by moveServiceFiles(). Where they are copied rather than moved, copyServiceFiles() calls InfoBarGenerics.renameResumePoint().

    Add a call of InfoBarGenerics.renameResumePoint() to renameCallback() to adjust the resume point cache when a file/directory is renamed Renaming recordings does not change the filename, and hence no change is needed to the resume point cache.

    Move the remaining calls of InfoBarGenerics.delResumePoint() to all be in the same relative position in the code, called at about the same point as where InfoBarGenerics.renameResumePoint() is called when called from moveServiceFiles() or copyServiceFiles().

    Add a call of InfoBarGenerics.delResumePoint() to purgeAll() to remove resume point cache entries when the Trash is emptied. This wasn't required in the previous code because moving items into Trash removed them from the cache.

    [Trashcan]

    Use MovieSelection.findMatchingServiceRefs() and InfoBarGenerics.delResumePoint() to delete resume points for files and recordings when they are deleted from trash.

    → <<cset 98730a0b005f>>

  2. Log in to comment