Jump to content

How to hide new sidebar


luser
Go to solution Solved by Luke,

Recommended Posts

luser

png.thumb.png.56210d1c1e0a2e5d6796bb7557ac492c.png

Please create an option to hide the new sidebar by default.
I know it can be hidden if the collapse button is clicked three times.
I was hoping there could be a default display setting for this sidebar, in order to avoid a "settings theme" situation; major display settings resetting with each visit.

Managing settings like these in localStorage via a userscript is annoying. Hopefully there will be a default for this...

  • Agree 1
Link to comment
Share on other sites

Hi, have you explored clicking the button in the top right hand portion of the sidebar?

Link to comment
Share on other sites

luser
1 minute ago, Luke said:

Hi, have you explored clicking the button in the top right hand portion of the sidebar?

Yes. From my original post:
"I know it can be hidden if the collapse button is clicked three times."

Link to comment
Share on other sites

  • Solution

OK no, there is no default at this time but not a bad idea for future updates.

Link to comment
Share on other sites

luser
1 minute ago, Luke said:

OK no, there is no default at this time but not a bad idea for future updates.

Thanks. I'll update my userscript... 😔

  • Thanks 1
Link to comment
Share on other sites

cochize1

was just about to post the same question. So with server 4.8 sidebar is open by default for every user? What file do I have to edit to make it collapsed at the start for everyone (I know I would have to update that with every server update but still better than cliecking it 3 times)?

Link to comment
Share on other sites

serpi

Just like removing the "local login without password", another thing the emby team thinks everybody would love to have instead of giving the user a choice.

Why not making such things optional from the beginning?

  • Like 1
Link to comment
Share on other sites

cochize1

@serpiI fully agree but temporarily as a workaround do you know what file would have to modified?  

Link to comment
Share on other sites

Baenwort
On 2/1/2024 at 10:59 PM, luser said:

Thanks. I'll update my userscript... 😔

Would you mind sharing how your modifying it for the rest of us to follow?

Link to comment
Share on other sites

cochize1

@luserso have you figured out how to hide the sidebar/drawer that is opened by default in new server version?

Link to comment
Share on other sites

tedfroop21

Find the three bar icon to the right of EMBY on the top of the side bar,  click on it and it collapses to icons,  open the sidebar by hovering, go to the icon and click again and it disappears.

Once its gone in your profile you have to click on the three bars to the left of Emby in the top left corner and again on the icon to the right of Emby when the sidebar opens to make it stay on again. 

Once its off - it stays off - unless an update or something turns it on again,  then its three clicks to shut it off.....

Edited by tedfroop21
Link to comment
Share on other sites

cochize1

well thanks, I knew about that function of course. What I'm asking is, what file (restored by any updated) should I modify to keep drawer closed from the beginning. I don't want to check or instruct all of my users how they can do them by themselves (as it impacts UX the way I have my web app modified by css) so I want to do it from the server side.

Other question I have, how do I make Collections show on un-pinned sidebar (they only appear when the sidebar is pinned)?

Link to comment
Share on other sites

  • 2 weeks later...
luser

Yeah,
You have to set the `<id>-drawerstyle` key's value to `closed` in localStorage.
Sadly this is how most of Emby's display settings are managed; in localStorage.

The only way to keep the setting is to not clear localStorage, or you can set the value yourself -- which is extremely annoying.
I set these values via a userscript. This way I can have the same settings across different devices AND clear localStorage.
There are other settings stored here too, for example the display mode of libraries (list, table, ect)

Link to comment
Share on other sites

Happy2Play
43 minutes ago, luser said:

Yeah,
You have to set the `<id>-drawerstyle` key's value to `closed` in localStorage.
Sadly this is how most of Emby's display settings are managed; in localStorage.

The only way to keep the setting is to not clear localStorage, or you can set the value yourself -- which is extremely annoying.
I set these values via a userscript. This way I can have the same settings across different devices AND clear localStorage.
There are other settings stored here too, for example the display mode of libraries (list, table, ect)

or modify the usersettingsbuilder.js.

Hide sidebar by default in 4.8 - Web App CSS - Emby Community

 

  • Thanks 1
Link to comment
Share on other sites

Baenwort
12 minutes ago, luser said:

Just keep in mind these changes will be overwritten every time the server is updated...

Hopefully they will make this something configurable in a future version or disable the duplication?

Link to comment
Share on other sites

luser
1 hour ago, Baenwort said:

Hopefully they will make this something configurable in a future version or disable the duplication?

Yeah, it would be nice to have persistent settings in a configuration file. It's very odd how they pick what should be stored in a config file and what should be stored in localStorage. Most people seem to be fine with never clearing their localStorage and setting up every new device/browser with their desired settings. It's been like this for years, I don't see it ever changing.

Link to comment
Share on other sites

cochize1
11 hours ago, luser said:

I set these values via a userscript. This way I can have the same settings across different devices AND clear localStorage.

Hey @luser, thanks for answering. Could you please elaborate a bit more on that bit with userscript as if your talking to a noob:) I would love to get a hang of being able to control my users default settings (as icon displays, drawer closed, enable backdrops, subtitles size etc.). I know I can do some of those by entering users account (I am setting those give them passwords) and the others by modyfing usersettingsbuilder.js as @Happy2Playmentioned but would love to automate that somehow. Thanks in advance.

Link to comment
Share on other sites

luser

@cochize1
Sure. Here's an example:

1. Download Tampermonkey

2. Create a new script and paste the following

// ==UserScript==
// @name         Emby Settings
// @description  https://emby.media/community/index.php?/topic/125483-how-to-hide-new-sidebar
// @version      1.0
// @match        http[s]://<hostname>[:port]/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

// Emby localStorage key/value paurs
const emby_settings = {
  "EMBY_USER_ID-drawerstyle": "closed"
}

function embyUserId() {
  for (let key of Object.keys(localStorage)) {
    if (key.startsWith("user-")) {
      let val = localStorage[key];
      let json = JSON.parse(val);
      let user_id = json.Id;
      if (user_id.length > 25) {
        return user_id;
      }
    }
  }
}

function embySettings(obj) {
  const emby_user_id = embyUserId();
  for (let key of Object.keys(obj)) {
    let val = obj[key];
    key = key.replace("EMBY_USER_ID", emby_user_id)
    localStorage.setItem(key, val);
  }
}

embySettings(emby_settings)

 

3. Edit the `@match` line at the top to match your emby host. Some examples would be:
    - http://192.168.1.3:8096/*
    - https://192.168.1.3:8096/*

4. Browse to Emby. If you're not already authenticated, you will have to reload for this script for it to take effect

5. Optionally update the `emby_settings` object with more key/value pairs.
    - When you change some settings in Emby, a key/value pair is saved in local storage.
    - Current values can be seen (in firefox) via: F12 => Storage tab => Local Storage => <Your emby host>
    - Replace the ID (your user ID) with EMBY_USER_ID. My script automatically sets it. This way, the script will work for multiple users.
    - I included an example below where I added a second key/value pair (changing the default view for a particular folder ID). Take note of the comma!

const emby_settings = {
  "EMBY_USER_ID-drawerstyle": "closed",
  "EMBY_USER_ID-items-123456-Folder-imageType": "list"
}

 

Hope that helps : )

Edited by luser
Link to comment
Share on other sites

cochize1

Wow, thanks. So basically it is just me who has to download tempermonkey in my browser (I actually already have it) but the settings will be distributed to all users as your script will fetch their ID automatically? And other question, where to look for possible options like imageType in your example, lets say to default subtitles to be displayed as huge? And will these settings persist if the user changes them on their side? 

Link to comment
Share on other sites

luser

> ...the settings will be distributed to all users as your script will fetch their ID automatically?
This method only works in the current browser. Anyone using your browser will have their settings overwritten by what's defined in `emby_settings`. You could definitely get a little fancier with the script and apply settings per-user. However, there's nothing "distributed" about a userscript. It's editing values in your browser, not Emby. Emby just uses these values.

> ...where to look for possible options like imageType in your example, lets say to default subtitles to be displayed as huge?
You'll just have to explore. Try to change Emby settings. For example, close the sidebar discussed in this thread. Check local storage to see if a new key/value pair exists: (in firefox) via: F12 => Storage tab => Local Storage => <Your emby host>. If it does, add this key/value to `emby_settings` and save the script.

> ...And will these settings persist if the user changes them on their
Anyone using your browser will have their settings overwritten by what's defined in `emby_settings`. You can test this by reopening the sidebar. Refresh the page. The sidebar is closed.

 

I'm not sure I understood your questions, but I hope this answers them.

  • Like 1
Link to comment
Share on other sites

cochize1

you understood them perfectly, thanks:) Unfortunately if you are looking to modify default settings for remote users you need to modify the files themselves. So the best way would be to run some batch file that would do that for you (also not sure if that only applies to Windows servers, as mine is on Synology NAS). But that is far beyond my capabilities:) Anyhow, I will play around and thank you for pointing me to a tempermonkey. I haven'y used it in awhile and I just googled what other scripts are people using and it might come in handy for my personal use on some other sites as well. 

Link to comment
Share on other sites

luser

Final thoughts:
You can setup Tampermonkey to update scripts automatically. If your users agree to install your userscript published somewhere (for example; github), their version could automatically update each time you update the script.

Another option is to edit Emby files programmatically with a tool like GNU sed. This way you easily re-apply your edits if the file changes. You would have to execute a script on a schedule, but this would also work. This also might break Emby on future updates :)

Both options are very clunky. A config file, for all settings and all user, from Emby would be ideal. However, I don't think we'll ever get that.

 

Anyway.. have a good one : )

Edited by luser
  • Thanks 1
Link to comment
Share on other sites

serpi
13 hours ago, Baenwort said:

Hopefully they will make this something configurable in a future version or disable the duplication?

Dont' hold your breath, making things "configurable" seems not to b a high priority for the devs, they just love to change things and we have to live with it.

Link to comment
Share on other sites

4 hours ago, serpi said:

Dont' hold your breath, making things "configurable" seems not to b a high priority for the devs, they just love to change things and we have to live with it.

Hi, you're in full control of the sidebar. Just click the icon in the upper right and you can change it from large to small to hidden as desired.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...