Some error paths out of this function are not setting the podcast status
to 'error'. Move the deferred error checking earlier to ensure the
status is set.
Signed-off-by: Eric B Munson <eric@munsonfam.org>
There were a number of error codes being returned that did not match the
the code given by the spec. Primarily this was the use of error code 10
(missing input parameter) when 70 (data not found) was the more
appropriate return. Though several uses of 10 are actually 0 (internal
server or unspecified error).
Signed-off-by: Eric B Munson <eric@munsonfam.org>
Currently, if a media item (track or podcast episode) is removed the
entries in the bookmark table that refer to the now missing media item
are left in the table. This commit adds a cleanup method which is part
of the scan.
Signed-off-by: Eric B Munson <eric@munsonfam.org>
Currently if a bookmark exists for an item that does not exist in the
db, either because it has been removed or it never did, the user is
prevented from retrieving any bookmarks. We can be in this state if
media has moved or been deleted, but also because the createBookmark
endpoint does not verify the item id provided.
This patch makes the getBookmarks endpoint ignore bookmarks for missing
items.
Fixes: https://github.com/sentriz/gonic/issues/578
Signed-off-by: Eric B Munson <eric@munsonfam.org>