causefx / Organizr

HTPC/Homelab Services Organizer - Written in PHP
GNU General Public License v3.0
5.12k stars 290 forks source link

Emby Homepage link for active stream does not work in the Emby Tab, only in a new window #1995

Open an0t8 opened 3 months ago

an0t8 commented 3 months ago
Organizr Version: V2.1.2490
Branch: Master
WebServer: Nginx - Docker (organizr/organizr)
Operating System: Ubuntu

Problem Description:

Attempting to click on the emby link in an active stream on the homepage will only work if not specifying the Emby Tab & WAN URL, and only in a new window.

First, I think that the WAN URL for the Emby homepage item is redundant and should be removed. I can only find it being used once, in Organizr/api/homepage/emby.php line 439: $embyItem['openTab'] = $this->config['embyTabURL'] && $this->config['embyTabName'] ? true : false; where it determines whether or not to try and launch the item detail URL in a tab. This seems to be leftover from when the user customizable Item Detail URL was added for Emby and Jellyfin.

That is not the only problem though, because putting anything in this field and setting a Tab name SHOULD be a work around to get the link to work, but it doesn't. Instead, if attempting to link to emby in the Emby tab, nothing happens on click but a javascript-void:(0) popup in the lower left corner when clicked (Chrome)

I know that linking homepage items to tabs work because sonarr & radarr links from the calendar work fine. I assume Jellyfin may have the same issue, but am not set up to test that.

It is also totally possible that I am using this wrong and don't know what to enter for the WAN URL and missed where it is being used.


Reproduction Steps:
  1. Configure the Emby Homepage Item to show active streams with permissions configured for the logged in user, and that the Emby connection is working.
  2. In the Misc tab, set the appropriate Item Detail URL, and ensure that the WAN URL and Tab Name are empty.
  3. Ensure there is an active stream in Emby
  4. Refresh the browser and go to the homepage, click on the emby icon on the active stream. Note that a new window pops up with Emby on the correct item.
  5. Return to the Emby homepage item's Misc tab, and enter the WAN URL (Doesn't seem to matter what is placed here) and the TAB name.
  6. Save and Refresh the browser, go to the homepage, click on the emby icon on the active stream. Nothing happens other than javascript-void(0);

Errors on screen? If so paste here:

javascript-void(0);
an0t8 commented 2 months ago

The issue with the existence of the WAN URL seems trivial and easy to workaround. I am no JS dev, but it seems that you can work around it easily just by putting something in the field. But once you get to js/custom.js line 1365, the openTab function, it just doesn't work. I noticed that sonarr/radarr links are opened in an entirely different way. The url & tab fields seem to be populated correctly, so I don't know what is broken.

an0t8 commented 2 months ago

I found the root of the problem. Organizr is expecting the tab to be identified as the tab number: #container-3, The emby homepage item is simply using the name: #container-Emby, and is not working. For sonarr/radarr in the calendar, it is running a query to get the tab id. Emby does not do that. A work around for now is to figure out the tab id and use that instead of the name. That will get you to the tab, but the link still doesn't load the correct item, just switches to the tab. I guess there is a lot more broken with this than I thought.

an0t8 commented 2 months ago

The lack of any attention on most of these issues is concerning. Has Organizr been abandoned?

causefx commented 2 months ago

not necessarily - i just need to find time to hunker down and do some of these...

causefx commented 2 months ago

at one point we swapped from tab names to ids. should be an easy fix - just need the time

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.