TIP: A quick hack to rename seasons

If you are using Plex to organize home video series or training videos, it’s sometimes handy to treat a group of related videos as a “Season” – but Plex forces them to be numbered, even if you’d rather have them named.



In previous versions of Plex, you could work around this with database tweaks or doing a PUT to the server… but now with Plex/Web you can do it even easier than ever before.



Just go to the season you want to rename, then click the edit button. Now, right click on the “summary” text area and use your browser’s text editing capability to add this:







just before the block. You’ll get a new field on the page, and clicking “Save” will actually save your changed season title. Nice!



Perhaps the Plex devs could officially add the input field in a future release, since it appears to literally just be a case of needing the field added – no new back-end work required. :wink:

Does not seem to work for me in Firefox nor IE for Windows...maybe I'm misunderstanding?  When you say:

Now, right click on the "summary" text area and use your browser's text editing capability...

Is that different than just left clicking in the textbox and entering text for the summary?  I don't see any block. Do you mean something special, when you say "browser's text editing capability" ?

I mean, you right click and pick "inspect element" or whatever other facility your browser has for editing the HTML in the page.  You have to edit the page's HTML to add the extra field.

Aaaah...I see what you mean now.  For Firefox, the key is to first install "Firebug", and then select "Inspect Element with Firebug".

Now I can see that the edited Season name appears, when I've selected that Season or an Episode in that season.  The only limitation is that when I just have a Show selected, so that the available Seasons are listed at the bottom, then the Seasons are still identified by number, and the edited Season names do not appear.

Still, this is a good step forward.  Thanks for the help!

Based on what PJE wrote, I put this together.

javascript:var ta = document.getElementById("lockable-summary");if(!ta){alert("Can't find submission form!");exit;} var outer = document.createElement("div");var nameLabel=document.createElement("div");var nameOb=document.createElement("input");var attName = document.createAttribute("name");attName.value = "title";nameOb.setAttributeNode(attName);nameLabel.innerHTML= "NAME:";outer.appendChild(nameLabel);outer.appendChild(nameOb);ta.parentNode.appendChild(outer);exit;

I haven't tested this anywhere but my own browser, but you ought to be able to copy/paste this into the 'URL' line in many of them to have the field added.  I threw it into a Firefox shortcut.

@tigycho: You’re the man! Your JS Snippet is priceless!!!

@PJE + @tigycho
you are geniuses.

i don’t want to derail this topic (so, if you reply, could
you reply @ the following link?),

would a similar solution work for

https://forums.plex.tv/discussion/255839/naming-discs-in-multi-disc-albums ?

I successfully edited a season name as per tyhe instructions in the first post…great. Then I wanted to change it and right clicking the summary box and inspecting (using Chrome) did not reveal the added code…anyone know how I get at it?

Ah… I’ve just repeated the naming process and that allowed me to change it again. Could someone explain what this process does?

Does it add code to the HTML? Does it just force PLEX to use the new name. Are there any gotchas to be aware of?
Cheers, Geoff

Hello!! I just found out this thread and I just want to thank you since this works! :smiley: I’m now writing a Tampermonkey script to automatically add the title input as soon as you open the edit modal window.

What I wanted to ask though, is that since we’re creating an input called name, then Plex must be saving that value somewhere under the name name right? Then why not officially exposing this feature and allow us to freely change seasons names without hacks? :disappointed:

since no one pasted a tampermonkey for this, here is my tampermonkey script. it looks a little nicer and makes it seem like its meant to be there.

also doesn’t show on pages it shouldn’t be on. it might not be perfect but i have yet to find where it breaks. also populates the name field with the current name.

enjoy.

// ==UserScript==
// @name        plex edit season names
// @namespace   Plex.tv
// @include     http*://<IP of PLEX>:32400/*
// @include     http*://app.plex.tv/*
// @version     1
// @grant       none
// @require     https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// @require     https://raw.githubusercontent.com/uzairfarooq/arrive/master/minified/arrive.min.js
// ==/UserScript==
$('body').arrive('.form-group', function(){
    if($(".form-group").attr("data-attr") == "summary" && $(".modal-body-pane form").children().length == 1){
        let name = $('[class^="PageHeaderLeft"] button').html();
        name = name.split('<div ')[0];
        $(".modal-body-pane form").prepend("<div class='row'><div class='col-md-12'><div class='form-group selectize-group' data-attr='name'><label for='lockable-name'>Name</label><div class='input-group'><a href='#' data-field='summary' class='input-group-addon edit-lock-addon' tabindex='-1'><i class='glyphicon lock'></i></a><input class='form-control lockable-field' id='lockable-name' name='title' value='" + name.replace("'", "&apos;").replace("\"", "&quot;") + "' /></div></div></div></div>");
    }
});
1 Like

I can’t seem to get this script to work. I add the script to tampermonkey, go to edit a season and the name thing isn’t there so I open chrome console to see if there are any errors and it seems that whenever I open up the edit season it seems to always just throw:

I’ve even tried to do it on https://app.plex.tv and it threw the same error. This is all running on Version 1.15.2.793 of PMS.

Have tried on a clean chrome install with only tampermonkey and the script as well, and it still ends up throwing the same error.

I have made some changes. can you try my newest version, just tested it again and it works.
if this doesn’t work if youre willing to work with me i can get it to work.

as long as you put your ip in the top it should work on both the plex.tv and internal link.

$('body').arrive('.form-group', function(){
    if($(".form-group").attr("data-attr") == "summary" && $(".modal-body-pane form").children().length == 1){
        let name = $(".modal-title").html();
        let courseName = $('[class^="PageHeaderBreadcrumbButton"]').html();
        name = name.substring(name.indexOf(courseName) + courseName.length + 3);
        $(".modal-body-pane form").prepend("<div class='row'><div class='col-md-12'><div class='form-group selectize-group' data-attr='name'><label for='lockable-name'>Name</label><div class='input-group'><a href='#' data-field='summary' class='input-group-addon edit-lock-addon' tabindex='-1'><i class='glyphicon lock'></i></a><input class='form-control lockable-field' id='lockable-name' name='title' value='" + name.replace("'", "&apos;").replace("\"", "&quot;") + "' /></div></div></div></div>");
    }
});

Your newest version worked :smiley: Thanks a bunch.

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