Skip to content

Commit

Permalink
Account for stub items when pruning
Browse files Browse the repository at this point in the history
Stubs don't have a location, since we scan for the colon in <server>:<path>, we need to account for an empty location

Related to #31
  • Loading branch information
jbrodriguez committed May 22, 2017
1 parent d0fe3ae commit d1c5cbe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/src/services/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:]
Expand Down

0 comments on commit d1c5cbe

Please sign in to comment.