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

Commit 8e28242

Browse files
authored
fix(targets/plex): add trailing slash to libraries (#102)
1 parent 6657d3c commit 8e28242

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

targets/plex/api.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,17 @@ func (c apiClient) Libraries() ([]library, error) {
127127
libraries := make([]library, 0)
128128
for _, lib := range resp.MediaContainer.Libraries {
129129
for _, folder := range lib.Sections {
130+
libPath := folder.Path
131+
132+
// Add trailing slash if there is none.
133+
if len(libPath) > 0 && libPath[len(libPath)-1] != '/' {
134+
libPath += "/"
135+
}
136+
130137
libraries = append(libraries, library{
131138
Name: lib.Name,
132139
ID: lib.ID,
133-
Path: folder.Path,
140+
Path: libPath,
134141
})
135142
}
136143
}

0 commit comments

Comments
 (0)