Plexasaurus - Collection Tag Manager

Hello all,

 

I am not sure that this is the correct category for this question. Please forgive me if not and let me know where it should be posted.

 

I am writing a Plex web application that provides a drag-and-drop interface for collection tags. I have it working, sort-of. However, I am not sure that I am going about it the correct way. I am modifying the main sqlite DB (com.plexapp.plugins.library.db) directly but the collection tag changes don't show up in the official Plex web interface.

 

Is there an API that I need to call to tell Plex to flush its cache or am I going about this the wrong way altogether?

 

App is here: https://github.com/midwire/plexasaurus

 

Thanks for any help.

Cheers,

 

 

![post-168377-0-24002600-1417033419.png|690x418](upload://blQUVLjh8ETJJxUZOdfQK8uK03i.png)

1 Like

I had the same issue.  I found that I had to use the web interface (api) to get it to work correctly.  In reality it made it sooooo much easier as I didn't need to understand the db at all.

I am working on a powershell script to pull the tags from imdb and insert into the collection for each movie.  It is pretty slick and requires not a lot of code on my part.

Here is an example that I have (powershell using rest methods):

#Updates the metadata for plex,given that you give it keywords and a valid plex id
Function MovieUpdater([String[]]$keywords,[string]$plexid)
{
     $inc=0
     $urih = "http://192.168.0.5:32400/library/metadata/" + $plexid + "?"
     $varurl = ""
     foreach($keyword in $keywords)
    { 
         $newk = $keyword.replace(" ","%20")
         $sect = "collection%5B" + $inc + "%5D.tag.tag=$newk"
         if ($inc -ne 0){$sect = "&" + $sect}
        $varurl = $varurl + $sect
        $inc+=1
     }
    $varurl = $urih + $varurl
    Invoke-RestMethod -Uri $varurl -method:Put
}
 
Function get-fullmovielist()
{
     $results=@{}  #hashtable of results
     $url = "http://192.168.0.5:32400/library/sections/2/all?type=1&sort=titleSort:asc&X-Plex-Container-Start=0"
     [xml]$RES = Invoke-RestMethod -Uri $url -method:get
     foreach ($node in $res.mediacontainer.childnodes)
     {
          $plexid = $node.ratingkey
          if ($plexid -ne $null -and $plexid -ne "")
          {
               $urlchk = "http://192.168.0.5:32400/library/metadata/" + $plexid + "?                 checkFiles=1&includeExtras=1&includeRelated=1&includeRelatedCount=0"
               [xml]$details = Invoke-RestMethod -Uri $urlchk -Method:Get
               if ($details -ne $null)
               {
                     $results.ADD($plexid,$details.MediaContainer.ChildNodes[1])
               }
          }
     }
     return $results
}
 
Some of the code above reads in a file that has words not to use in collections - for example: "newspaper, iron, man holding gun" etc.
 
Cade
1 Like

Where is the bundle file for this app. This sounds amazing. Sadly, the box for “Get Collection Info from” was selected on one of my agents. And it tagged everything with a weird collection tag. Sadly, those tags don’t even show up when I hit the edit on a specific title. I need to clear them.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.