Skip to content

Commit

Permalink
Be sure to optimize every type of thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
Arno500 committed Nov 5, 2022
1 parent 40e000a commit 6cf972c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion discord/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func SetRichPresence(session types.PlexStableSession, owned bool) {
} else {
activityInfos.State = session.Media.GrandparentTitle
}
activityInfos.LargeImage = getThumbnailLink(session.Media.Thumbnail, session.PlexInstance)
activityInfos.LargeImage = getThumbnailLink(session.Media.ParentThumbnail, session.PlexInstance)
activityInfos.Details = fmt.Sprintf("%s (%s)", session.Media.Title, session.Media.ParentTitle)
} else if session.Media.Type == "photo" {
text := i18n.Localizer.MustLocalize(&i18npkg.LocalizeConfig{
Expand Down
2 changes: 2 additions & 0 deletions plex/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func createSessionFromWSNotif(wsNotif plex.PlaySessionStateNotification, Plex *p
Title: mediaInfos.MediaContainer.Metadata[0].Title,
Year: mediaInfos.MediaContainer.Metadata[0].Year,
Thumbnail: mediaInfos.MediaContainer.Metadata[0].Thumb,
ParentThumbnail: mediaInfos.MediaContainer.Metadata[0].ParentThumb,
GrandparentThumbnail: mediaInfos.MediaContainer.Metadata[0].GrandparentThumb,
},
Session: types.PlexSessionKey{
Expand All @@ -161,6 +162,7 @@ func createSessionFromSessionObject(wsNotif plex.PlaySessionStateNotification, s
Title: session.Title,
Year: session.Year,
Thumbnail: session.Metadata.Thumb,
ParentThumbnail: session.Metadata.ParentThumb,
GrandparentThumbnail: session.Metadata.GrandparentThumb,
},
Session: types.PlexSessionKey{
Expand Down
27 changes: 14 additions & 13 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,20 @@ type PlexStableSession struct {

// PlexMediaKey is a subkey of PlexStableSession
type PlexMediaKey struct {
RatingKey string
Type string
Duration int64
Director []plex.TaggedData
Thumbnail string
GrandparentThumbnail string
Index int64
ParentIndex int64
GrandparentTitle string
OriginalTitle string
ParentTitle string
Title string
Year int
RatingKey string
Type string
Duration int64
Director []plex.TaggedData
Thumbnail string
ParentThumbnail string
GrandparentThumbnail string
Index int64
ParentIndex int64
GrandparentTitle string
OriginalTitle string
ParentTitle string
Title string
Year int
}

// PlexSessionKey is a subkey of PlexStableSession
Expand Down

0 comments on commit 6cf972c

Please sign in to comment.