Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Metadata Handling and PlaybackSession Metadata Robustness #3690

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Vito0912
Copy link
Contributor

@Vito0912 Vito0912 commented Dec 7, 2024

Brief summary

This appends the server's existing mediaMetadata to the playbackSession if the client does not supply it.

Which issue is fixed?

This resolves server crashes caused by missing mediaMetadata (even though they are addressed separately) and corrects inaccurate stats when the client does not provide mediaMetadata. Additionally, it slightly reduces bandwidth usage during local session syncing.

In-depth Description

If mediaMetadata is absent in the payload sent by the client, the server will use the metadata it already has (libraryitem.media.metadata).
Only essential attributes are included in the playbackSession to avoid unnecessary data, such as descriptions, which are often lengthy and typically unneeded.
Additionally, displayTitle and displayAuthor will fall back to the corresponding mediaMetadata values when not provided, ensuring they are displayed even if the client does not sends them.

How have you tested this?

This has been tested with both my own client and the web client.


Copilot summary

This pull request includes changes to the PlaybackSessionManager class to ensure that client-provided metadata is preferred over library metadata when available. This change aims to make the system more robust and user-friendly by prioritizing user-specific information.

Improvements to metadata handling:

  • server/managers/PlaybackSessionManager.js: Added logic to prefer client-provided metadata (such as title, subtitle, narrators, authors, series, genres, and author) over library metadata if available. This ensures that important metadata is synchronized and displayed correctly.

@Vito0912 Vito0912 changed the title Feat/metadata for playback sessions Improved Metadata Handling and PlaybackSession Metadata Robustness Dec 7, 2024
@nichwall
Copy link
Contributor

nichwall commented Dec 7, 2024

This makes sense to me, along with the fix for the crash in #3689.

Taking a brief look at the database, we probably want to remove the coverPath, mediaMetadata, displayTitle, and displayAuthor from the table entirely and just fetch that information from the relevant podcastEpisodes or books table row when requesting playback sessions. I have opened #3691 to track that separately. (this may have been mentioned before but I am forgetting if so)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants