home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.71k stars 28.87k forks source link

Synology photos shared items are not visible in the media browser #120817

Open ethemcemozkan opened 3 days ago

ethemcemozkan commented 3 days ago

The problem

My setup is:

The problem is: While navigating the Synology album using HA media browser photos owned by the integration user works fine, thumbnails are visible, but if photos are owned by another user media browser cannot open it and thumbnails are broken. Screenshot 2024-06-29 130523 image

This is the same issue described in https://github.com/home-assistant/core/issues/103653, but for me it still happens even with the version 2024.6.4 in which a fix for this issue is included.

What version of Home Assistant Core has the issue?

2024.6.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Synology DSM

Link to integration documentation on our website

https://www.home-assistant.io/integrations/synology_dsm

Diagnostics information

home-assistant_synology_dsm_2024-06-29T11-27-00.468Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 3 days ago

Hey there @hacf-fr, @quentame, @mib1185, mind taking a look at this issue as it has been labeled with an integration (synology_dsm) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `synology_dsm` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign synology_dsm` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


synology_dsm documentation synology_dsm source (message by IssueLinks)

lodesmets commented 1 day ago

I tested it when developing the fix, and it worked then. I haven't tested it when it is integrated.

The problem is, I use Synology photos without sharing. So it is difficult to test everything.

Lets say user A is the user you use with the integration and user B is the other one. Is user A the one who created the album, and shared it with B? Or did B create the album and share it with A?

ethemcemozkan commented 1 day ago

@lodesmets, I think it is the first case. User A: owns the album, also is the user HA using to connect. It also have pictures owned by itself in the album. These pictures are visible in the media browser User B: Album is shared with this user, it adds a few photos into this album, which are not visible in the media browser.

lodesmets commented 55 minutes ago

Hey, I'm looking at your logs: The images that work have owner_user_id 4: {'id': 17081, 'filename': 'wp11611080-2000x1200-wallpapers.jpg', 'filesize': 1743048, 'time': 1717362360, 'indexed_time': 1717414576108, 'owner_user_id': 4, 'folder_id': 142, 'type': 'photo', 'additional': {'thumbnail': {'m': 'ready', 'xl': 'ready', 'preview': 'broken', 'sm': 'ready', 'cache_key': '17081_1717407736', 'unit_id': 17081}}}

The ones that don't work have user_id 2: {'id': 20167, 'filename': 'IMG_0257.JPG', 'filesize': 406987, 'time': 1719490272, 'indexed_time': 1719497050888, 'owner_user_id': 2, 'folder_id': 7, 'type': 'photo', 'additional': {'thumbnail': {'m': 'ready', 'xl': 'ready', 'preview': 'broken', 'sm': 'ready', 'cache_key': '20167_1719489851', 'unit_id': 20167}}}

I only use shared albums with a link and users that don't have an account. In this case the user_id is always 0

So I will have to create another user and test it that way. I'll let you know if I find anything.

The main problem is that synology photos doesn't have a public documentation for the api, so everything was reverse engineered.