I have been using PSM for years now and been frequently reading the forum since then. I have also followed the threads regarding the possibility to delete media from the server right away from the PS3. However the danger of accidently deleting files is high and thus I understand the objection against such a feature.
I am starting a new thread because this will be the thread of my plugin "RemoteDelete" currently in development that will (in antithesis to its name) never delete any file but still give you the possibility to ged rid of unwanted media.
You may expect a beta within a week. I am posting ahead already because I have some questions to the PMS crew and/or other developers regarding a few optimizations of my plugin. If you cannot help me with that you can skip the next paragraphs. At the end of the post I include my current readme-draft that outlines the features to be expected in the first beta release.
Development Questions:
All questions are regarding the current head from SVN.
Any better Method of refreshing (virtual) folders?
First I was using the DLNAResource.refreshChildren() method but that would take forever to take place. Sometimes it does not occur within 10 minutes. My current method of rebuilding folders is .getChildren().clear() which takes place within a minute, sometimes even immediately but will always be faster if you completely leave the media and reentering the folder from root. So is there any better / faster method of rereshing the media structure during runtime.
Is there a way to tell PMS to close all File Handles to specific media files or directories
RemoteDelete gets unwanted files out of the scope of PMS by moving them to a folder outside the media folders. My currently favored option is to queue and retry the operation in specific intervals since PMS seems to unlock the files after a while. I have also been thinking about restarting PMS for emptying the trash as well as utilizing tools like Unlocker.
The first isn't immediate, the second makes the PS3 disconnect from the server for a while and the third isn't platform independent. I'd like to find a better way.
Serially marking files for deletion with "gestures"
In addition to the ##-MARK FOR DELETION-## folder on each media folder I would like to implement a second method of moving files to my virtual trashcan which shoud work as follows.
Each media folder has a virtual folder that recursively collects all media from the subfolder structure.
Each file in this virtual folder begins playing in the middle of the video and is shortened to 10 seconds of playback.
If the user skips to the next video within the 10 seconds, the video shall be marked for deletion. Otherwise it will be kept if the full 10 seconds are played and the PS3 moves on to the next file.
Do you think it is possible to do this between buffers, network and unprecise timing?
So here's the Readme:
Though this plugin is called RemoteDelete it will actually NEVER DELETE any files or folders from your media server. The reasons why this would be to dangerous have been discussed on the official forum.
Instead it allows you to use your Media Renderer (i.e. PS3) to mark files and folders for "deletion". In the RemoteDelete virtual folder in your library you will be able to empty the trash which will still NOT DELETE but move the "deleted" files and folders to a folder outside the scope of PMS.
So these are the Steps to happy deletion
1.) Browse your Media Files and mark things for deletion
2.) Empty The Trashcan (using your Media Renderer) which will move the files to a folder outside the PMS library (By Default it is <Root Of Drive>/PMS_Trashcan)
3.) Manually empty the Trash Folder from time to time or use a task scheduler / cronjob to have it done automatically
Configuration options explained:
rdLogEnabled (true/false, default true) & rdLogPath (default plugins/RemoteDelete.log):
rdLogEnabled enables the log output of RemoteDelete. rdLogPath is the path to the logfile. If you do not specify an absolute path the log will be written relatively to the PMS program folder.
rdAsyncMoveQueueInterval (Interval in seconds, default 60):
Normally the movement of the files should be very fast since RemoteDelete maintains (tries to maintain) a trashcan folder for each partition. But sometimes the media server itself locks files or directories while maintaining its library. As long as thos are locked the files cannot be moved. Therefore RemoteDelete maintains a queue of items to be moved to the trash folder and retries to move previously locked items at the given interval.
rdDeleteFolder (One relative path OR comma separated list of absolute paths, default PMS_Trashcan):
RemoteDelete tries to quickly move deleted items to the specified trash folder. This normally succeeds if source and destination reside on the same physical harddrive. From within Java it is not easy to determine the boundaries of physical harddrives on every OS.
On Windows you should be fine with the defaults. RemoteDelete will move the files to the Root of the Drive (i.e. C:\PMS_Trashcan, D:\PMS_Trashcan, ...)
On Linux the defaults are probably not that good because the trashcan will be /PMS_Trashcan by default. You should define rdDeleteFolder with a list of the mount points of your physical harddrives containing media (i.e. rdDeleteFolder=/var/media/PMS_Trashcan,/home/peter_paul_and_mary/PMS_Trashcan. RemoteDelete will automatically chose the best folder for each moved file or folder from the list.
Mac OS? Hell be a man and buy yourself a computer. These glossy and shiny things don't do anything well.
rdKeepAsyncMoveQueueOnDisc, rdKeepTrashcanOnDisc (true / false, default true):
If true RemoteDelete will rescue remember in the virtual trashcan folder and move queue after a crash or restart of PMS. Otherwise it will keep these lists only in RAM.
rdKeepFolderStructureInTrashcan (true/false, default true):
Specfies if RemoteDelete should move files and folders with their complete path.
Example: Sourcefile is D:\Videos\Movies\Terminator\Terminator.mkv
Destination if true: D:\PMS_Trashcan\Videos\Movies\Terminator\Terminator.mkv
Destination if false: D:\PMS_Trashcan\Terminator.mkv
Feel free to post suggestions and feature requests
