From d1c5cbee6a074038d030b9f8b7e0ed9badc3cf5a Mon Sep 17 00:00:00 2001 From: "Juan B. Rodriguez" Date: Mon, 22 May 2017 13:55:03 -0500 Subject: [PATCH] Account for stub items when pruning Stubs don't have a location, since we scan for the colon in :, we need to account for an empty location Related to #31 --- server/src/services/core.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/services/core.go b/server/src/services/core.go index a1453fb..9c8a09c 100644 --- a/server/src/services/core.go +++ b/server/src/services/core.go @@ -230,6 +230,11 @@ func (c *Core) pruneMovies(msg *pubsub.Message) { // mlog.Info("Item is %s (%s)", item.Title, item.Location) index := strings.Index(item.Location, ":") + if index == -1 { + // a valid location is wopr:/mnt/user/films/bluray/22 Bullets (2010)/22.Bullets_BLURAY.iso + // if a ':' isn't found, then this must be a stub + continue + } host := item.Location[:index] location := item.Location[index+1:]