The plugin was originally concieved and implemented by BikeMike, and I've been maintaining and improving it with his agreement.
The initial changes I made to BikeMike's code are listed below the more recent release notes.
Using Series2Folder
- Series2Folder moves recordings with the same name into folders that have the same name as the recordings. It can be configured to do that automatically in the background.
- When it has been installed, it is accessed via MEDIA, MENU, and the menu entries "Sel Series to Folder", "Series To Folder" and "Series to Folder...". The three functions can also be assigned to coloured buttons in MEDIA, MENU>Settings. The lengths of these menu names are restricted by the amount of space for them in the coloured buttons.
- "Sel Series to Folder" moves all recordings that have the same name as the currently highlighted recording into a folder. If any recordings are marked, it will operate on those recordings rather than the highlighted recording. It creates the folder if necessary. It will only appear in MEDIA, MENU if it has been enabled in the configuration.
- "Series To Folder" finds all recordings where there are more than a certain (configurable) number of recordings with the same name, and moves them to folders with their respective names, creating the folders if necessary. This action can also be enabled as an automatic background activity. It will only appear in MEDIA, MENU if it has been enabled in the configuration.
- "Series to Folder..." pops up a menu that contains the previous two functions (but with longer and more obvious names), and also an entry to open Series2Folder's setup panel.
- The "Configure move series recordings to folders" settings panel has the following entries:
- Show move series option: allow "Series To Folder" to appear in the media selection screen menu and/or on coloured buttons. The function is always available in the "Series to Folder..." menu.
- Show move selected series option: allow "Sel Series To Folder" to appear in the media selection screen menu and/or on coloured buttons. The function is always available in the "Series to Folder..." menu.
- Automatically create folders: sets the minimum number of recordings with the same name needed before "Series To Folder" will create a directory for them and move recordings into the folder. It applies to both manual and automatic runs of "Series To Folder". Setting it to "no autocreate" means that recordings will only be moved by "Series To Folder" if the folder exists already. Combining "no autocreate" with "Sel Series to Folder" is an easy way to put only some of your series recordings into folders automatically.
- Strip repeat tags from series names: when enabled, removes a repeat tag from the recording name before using the name as a folder name. When enabled, "Repeat tag to strip" also appears, and allows you to set the repeat tag (defaults to "[R]").
- Use portable file names: when creating the folder name from the series name convert any characters not allowed in Windows filenames to "_". Most useful if you share the folder with a Windows computer.
- Put movies into folder: allows Series2Folder to move all recordings whose names start with "Movie: " (case insensitive) into a folder. When enabled, "Folder for movies" appears to allow the name of the folder to be changed (defaults to "Movies").
- Allow Series to Folder to run in the background: effectively does a "Series To Folder" automatically in the Default movie location shortly after startup and shortly after the end of each recording. The move can be deferred if you are in the media selection screen or in FileCommander.
- Series to Folder notifications: allows you to control when Series2Folder notifies you about its background actions. The options are "all", 'error and "moved" ' and "error". The "all" option will notify each time Series2Folder runs, even if it finds nothing to do. The default is "error".
- Add a message to the Series2Folder config popup that tells users how to enable background mode. It shows for a maximum of 5 times, or until background mode is enabled.
- Ask user when cancelling Series2FolderConfig when there are unsaved changes.
- Default to a single Series to Folder... plugin entry in the MEDIA, MENU menu. The menu now no longer includes the "Series to Folder" and "Sel Series to Folder" entries by default. The short names for the Series to Folder and Sel Series to Folder aren't obvious, and are now explained a little in the config popup, where they can be enabled, if desired. If you previously had these entries displayed in the media selection menu, you will need to enable them. This change was made at the request of Colin O'Brien from IceTV.
- Support added for multi-file selection in Beyonwiz MEDIA, MENU screen. You can now mark multiple recordings, and "Move selected series recordings to folder" will move all the recordings matching the marked names to their respective series folders.
- Other minor improvements to explanations.
- Make Series2Folder portable betweewn Python 2 and Python 3 (should be invisible to users).
- Make Series2Folder portable across Beyonwiz, OpenViX and OpenATV (should be invisible to users).
- Make file screen handling more flexible - this helps control when background runs will be blocked by the user being in a context viewing files and where moving files around may casus problems (should be invisible to users).
- Cleanup of code for displaying config items that are only active when other config items are enabled (should be invisible to users).
- Only show the BLUE Keyboard button hint when focus is on a config item that actually allows text entry.
- Has some changes to make the code more portable to OpenATV and OpenViX, but it is not yet portable to those systems.
- Allow manual (menu or button) moves of series recordings to folder in any folder, not just in the Default movie location. Adoxa's idea, but a slightly different implementation from what he proposed.
- Background moves now follow the user's setting in Default movie location without having to restart the plugin.
- Handle all recording filename formats (Long filenames, Short filenames, Event first, as well as standard).
- Avoid over-writing existing files in destination directory.
- Fix crash when default movie directory doesn't exist.
- Minor code cleanups
- Fix crash when "zap" timer is running when Series2Folder runs.
- Fix crash when "Series to Folder is already running in the background." popup was to be displayed.
- Two minutes after startup, and 5 seconds after the end of each recording, it runs in the background to move any new matching recordings to their destinations.
- It works in a cooperative manner, returning control to the main dispatch loop of the UI frequently to make sure that it doesn't unnecessarily block other operations.
- It is initially disabled, and can be enabled in the plugin's settings. When enabled, you can choose which of the popup notifications you see when it completes a scan: all (including notifications that it has done an automatic scan and not found anything), errors and a list of moved recordings, only errors, or none. The default is "only errors".
- Before it starts and at each processing step, it checks to see whether the system is shutting down or if there is a (or another) recording running and stops its run immediately. If the system stays running, it will run again after the next recording finishes. If the system goes into shutdown, it will run again when it restarts. The "recording running" test may be too conservative, and I'll have a look at whether something better can be done.
- If there are any tasks running or the current screen is either MovieSelection or FileCommander, it defers for a minute (and then retests the conditions). This stops the files being changed "behind the back" of those screens.
- If the manual Series2Folder operations detect that the background Series2Folder is running, they don't do anything, and give an information popup saying that Series2Folder is running in the background.
- Other than the two settings specific to automatic scanning, the automatic scan uses the same configuration settings as the manual scan.
- Fixed bug that caused a crash if a recording's .ts.meta file couldn't be read.
- Added the version number to the title of the plugin settings popup.
- Add new PluginDescriptors for single-action "move series to folder" and "move selected series to folder". The single-action plugin descriptors "Series to Folder" and "Sel Series to Folder" have the same effects as the menu entries "Move series recordings to folders" and "Move series recordings to folders" respectively.
- Shortened the plugin descriptors so that they now fit in the button hints if the actions are assigned to coloured button short-presses.
- Split out the "move series" action code into a separate class to allow for the actions, and as a first step to allow automation (should have no user-visible consequences).
- Allow the "Series to Folder" and "Sel Series to Folder" actions to be configured in or out. If configured out, they are still available through the "Series to Folder" popup.
- Avoid moving recordings if they are part of a pending merge for a "save timeshift" recording.
- Don't move any recordings and display a popup if there are jobs running (which could operate on recordings), or if the PVR is in the process of shutting down.
- Allow repeat tagging (e.g. added by IceTV) to be stripped from series names when creating their folders. This also allows repeat movies to be recognised if the repeat tag is at the start of the title (e.g. "[R] Movie: Gone with the Wind"). The default repeat tag is the same as the IceTV default tag, "[R]", but it can be modified to match a different tag configured on IceTV (e.g. '[Rpt]").
- Optionally (default enabled) replace characters not permitted in Windows filenames (/.\:*?<>|") with '_' when creating folder names from series names.
- When there are errors, or if more than 20 shows are moved to folders, use a TextBox (wider, scrollable and with text wrapping) to display
the results. - Use lists to collect user feedback strings and error messages instead of a single string for more flexible presentation.
- When nothing has been moved, increase the timeout on the message box from 5 sec to 10 sec.
- Use gettext for all UI strings.
- Added bitbucket source url to control file.
- Made it a package, so it's a bit easier to install and uninstall (but before installing BikeMike's original version, you have to manually uninstall the original).
- It has a more robust (but a little slower) way of working out the series name than the original.
- When it finishes a run, it automatically updates the list in the Movie Player (MEDIA from live TV).
- It avoids moving recordings that are currently being recorded.
- It has some options, and that means that when you select MENU>Move series recordings into folders, you now get a menu instead of it just running. If you just press OK again (Move series recordings to folders) without making any config changes, you should get the same behaviour as the original - it creates folders for all series with two or more episodes. It then moves the episodes for all series that have folders into their folders, whether the folder was created automatically or not. The folder just has to have the right name.
- There's a new action, Move selected series recording into folder. That acts on just the episodes of the recording that was selected in the Movie Player when you pressed MENU. It will always create a folder for the series if there isn't one, no matter how many episodes there are, and it then moves all episodes into that folder. In combination with a setting below, this allows you to be selective about which series get folders.
- The plugin only appears in the Movie Player's MENU when the focus in the selection list is on a recording or file. This is an inherent limitation of how the menu is constructed in the Movie Player; the plugin can't change that.
- There's a small configuration setup screen with three settings:
- Automatically create folders: with settings "no autocreate" and "1 recording" .. "10 recordings". This allows you to change the threshold for the number of recordings needed to automatically create a folder in Move series recordings to folders. If it's set to "no autocreate", then Move series recordings to folders will only move recordings to folders that already exist - either created manually, or more conveniently, by Move selected series recording into folder.
- Put movies into folder: looks for recordings whose names start with "Movie: " and puts them into a folder (defaults to "Movies"). If this is enabled, you can use Move selected series recording into folder to move a single movie into a folder (but Move series recordings to folders will still move all movies into the Movies folder if the Movies folder exists).
- Folder for movies: the name of the folder to put movies into. If you change this name then movies in the folder with the old name will just stay there, and newly moved movies will go into the folder with the new name.
If you don't have Series2folder installed or you have an earlier version installed from a package, just install the new version as follows.
On the Beyonwiz, set it to view live TV.
Download the linked enigma2-plugin-extensions-series2folder_version_all.zip file to the top level of a USB stick, unzip it to get the enigma2-plugin-extensions-series2folder_1.0_all.ipk file inside, delete the .zip file and then "Remove safely/Eject" it from your computer and plug it into your Beyonwiz.
After a few seconds you'll get a "The following files were found/Install extensions" popup. Click OK. You should see the .ipk file listed on the screen. Navigate to it and press OK to select it (tick the box). Then press GREEN Install. When that finishes, press EXIT on the "Done" popup, and EXIT again to leave the installer screen.
Then restart the GUI (or reboot).
Once that's done, the Move series recordings into folders entry will be in the MENU list in the Movie Player (MEDIA from live TV).
Uninstalling
Use PLUGIN from live TV, then RED Remove plugin. Navigate to extensions, press OK to open the list, then navigate down to series2folder and press OK. The plugin will be uninstalled. No need to restart the GUI or reboot.
You can't uninstall the original version of Series2folder this way.
Source
The the source code can be found at https://bitbucket.org/prl/series2folder. It's not very big. There's a Makefile, but it depends on copying the plugin to a Beyonwiz to compile it and needs the ipkg-build script (I lifted mine from the opkg-tools package for the Beyonwiz). It's a bit clunky and inconvenient.
The source directory can be downloaded from Bitbucket as a ZIP file and installed in a similar way as the original version if you want to, but it needs to be removed manually before you use the .ipk package. Use the package unless you want to hack the source or you're just nosy
Package downloads
The plugin (already un-zipped) can also be downloaded from Bitbucket at https://bitbucket.org/prl/series2folder/downloads.
.