jellyfin / mopidy-jellyfin

Jellyfin Extension for Mopidy
https://jellyfin.org
Apache License 2.0
93 stars 16 forks source link

Coverarts not displayed in special configuration (https reverse proxy, docker environment) #140

Open CDaxi opened 1 year ago

CDaxi commented 1 year ago

Hello,

my setup:

In this case, I am not able to get the coverarts displayed.

Tried hostname configurations:

As seen in https://github.com/jellyfin/mopidy-jellyfin/blob/30a09c3c4018ca38749f313ad7dc35eb70f4908f/mopidy_jellyfin/remote.py#L952, the self.hostname is used in this case.

Ideal for my use case would be if I can define an internal hostname (docker hostname) to fetch the data and a public hostname (using at frontends) to display the coverart.

e.g.:

changing this code:

    def get_image(self, item_id):
        url = f'{self.hostname}/Items/{item_id}/Images/Primary'
        # Verify if image exists instead of returning bad URLs
        image = self.http.head(item_id, url)
        if image:
            return models.Image(
                uri=url,
            )
        else:
            return []

into something like:

    def get_image(self, item_id):
        url = f'{self.public_hostname}/Items/{item_id}/Images/Primary'
        # Verify if image exists instead of returning bad URLs
        image = self.http.head(item_id, url)
        if image:
            return models.Image(
                uri=url,
            )
        else:
            return []

and if public_hostname is not set at the configuration, the same value as for hostname should be used.

Would be great if somebody can add the feature to the extension. Thanks a lot.

CDaxi

CDaxi commented 1 year ago

Sorry for interrupting again. I have seen that there is a port in the ext.conf file which seems never used in the code. From my point of view having different hostnames for backend and frontend possible would be the best solution.