Saturday, 28 May 2016

Plex Media Server - Recently added stuck in front

So i had an issue where few movies were stuck in fromt of the recently added queue.

Tried removing and re-adding them to Plex with no luck.

As the metadata for all the items are stored in a sqlite3 database the following procedure were used to correct the instances.

Steps to follow:

  1. Find the item you want to edit
  2. Find the database to edit
  3. Exit Plex and update the database file.

Item you want to edit:

Select the movie or episode in question and select "..." >  "Info" or "Get Info" > "View XML" Bottom left of the window.
The property "ratingKey" is the id you need to update in the database.
Note: The date/time is stored in Unix Time in the XML output.

Database location:

On Windows install a SQLite editor e.g. SqliteBrowser
The database is located at


%LOCALAPPDATA%\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db


by default or can be found from the web interface: Settings > Server > General > "

Open the database and select the "metadata_items" table.



Browse or search for the id with the value of ratingKey.
Update the time to the correct date/time, easiest would be to make the added_at value same as the created_at value.

Write/Save the changes back to the sqlite3 database and restart plex.



Command line:

This can be done from the command line as well with a command like:

UPDATE metadata_items SET added_at = created_at WHERE id=[value of ratingKey]



Wednesday, 25 May 2016

Splitting FLAC files based on CUE

image from https://en.wikipedia.org/wiki/FLAC
Install the following packages
  • cuetools
  • shntool
  • flac

sudo apt-get install cuetools shntool flac

Now the FLAC file can be split as follows:

cuebreakpoints inputfile.cue | shnsplit -o flac inputfile.flac

The result will be as follows: 
split-track01.flac
split-track02.flac
....



Wednesday, 4 May 2016

For when nohup is not available

So I recently had to execute a long running job on a bash shell,
however none of my usual tools like nohup, screen or tmux were available so below is the method I used to make sure I can start the job and disconnect the session.

  1. run the job in bash
  2. whilst running press ctrl-z (this will suspend the current foreground job (task)  )
  3. enter the job control command bg to add it as a background task
  4. then remove the job from the shell's job list disown -h 
  5. exit