Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
fix(targets/plex): add trailing slash to libraries (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-rots authored Mar 11, 2021
1 parent 6657d3c commit 8e28242
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion targets/plex/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,17 @@ func (c apiClient) Libraries() ([]library, error) {
libraries := make([]library, 0)
for _, lib := range resp.MediaContainer.Libraries {
for _, folder := range lib.Sections {
libPath := folder.Path

// Add trailing slash if there is none.
if len(libPath) > 0 && libPath[len(libPath)-1] != '/' {
libPath += "/"
}

libraries = append(libraries, library{
Name: lib.Name,
ID: lib.ID,
Path: folder.Path,
Path: libPath,
})
}
}
Expand Down

0 comments on commit 8e28242

Please sign in to comment.