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

Plex titles need to truncate better if too long #55

Open
s0up4200 opened this issue Nov 17, 2024 · 0 comments
Open

Plex titles need to truncate better if too long #55

s0up4200 opened this issue Nov 17, 2024 · 0 comments
Labels

Comments

@s0up4200
Copy link
Collaborator

Describe the bug
Title

To Reproduce
Start playing something with a long title.

Screenshots
Image

Proposed Fix

diff --git a/web/src/components/services/plex/PlexStats.tsx b/web/src/components/services/plex/PlexStats.tsx
index 33316e9..5d20dce 100644
--- a/web/src/components/services/plex/PlexStats.tsx
+++ b/web/src/components/services/plex/PlexStats.tsx
@@ -284,16 +284,18 @@ export const PlexStats: React.FC<PlexStatsProps> = ({ instanceId }) => {
                         {getMediaTypeIcon(session.type || "", session.Player?.state)}
                       </span>
                       <div className="flex items-center justify-between flex-1">
-                        <span className="text-xs font-medium text-gray-200 truncate" title={session.title}>
-                          {session.type?.toLowerCase() === "movie"
-                            ? session.grandparentTitle
+                        <span className="text-xs font-medium text-gray-200 flex items-center min-w-0 flex-1">
+                          <span className="truncate max-w-[95%]" title={session.title}>
+                            {session.type?.toLowerCase() === "movie"
+                              ? session.grandparentTitle
+                                ? `${session.grandparentTitle} - ${session.title}`
+                                : session.title
+                              : session.grandparentTitle
                               ? `${session.grandparentTitle} - ${session.title}`
-                              : session.title
-                            : session.grandparentTitle
-                            ? `${session.grandparentTitle} - ${session.title}`
-                            : session.title ?? ""} 
+                              : session.title ?? ""}
+                          </span>
                           {session.type?.toLowerCase() === "clip" && (
-                            <span className="text-purple-400 ml-1">(Trailer)</span>
+                            <span className="text-purple-400 ml-1 shrink-0">(Trailer)</span>
                           )}
                         </span>
                         {isTranscoding(session) && (
@s0up4200 s0up4200 added the web label Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant