{"id":8773,"date":"2022-03-14T20:24:34","date_gmt":"2022-03-15T01:24:34","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=8773"},"modified":"2022-03-15T11:44:38","modified_gmt":"2022-03-15T16:44:38","slug":"gerbera-searching-for-playlists","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=8773","title":{"rendered":"Gerbera &#8211; Searching for Playlists"},"content":{"rendered":"<div class=\"comment js-suggested-changes-container\" data-thread-side=\"\">\n<div class=\"comment-body markdown-body js-preview-body\">\n<p dir=\"auto\"><strong><em>Summary:<\/em><\/strong> Playlist items are not returned from searches initiated on my uPNP client. The playlist is visible when browsing the Gerbera web UI under Playlists-&gt;All Playlists-&gt;Playlist Name and Playlists-&gt;Directories-&gt;Playlists-&gt;Playlist Name<\/p>\n<p dir=\"auto\"><a href=\"https:\/\/www.rushworth.us\/lisa\/?attachment_id=8774\" rel=\"attachment wp-att-8774\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8774\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/Gerbera-PlaylistsAreThere.png\" alt=\"\" width=\"332\" height=\"512\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/Gerbera-PlaylistsAreThere.png 332w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/Gerbera-PlaylistsAreThere-195x300.png 195w\" sizes=\"auto, (max-width: 332px) 100vw, 332px\" \/><\/a><\/p>\n<p dir=\"auto\"><strong><em>Action:<\/em><\/strong> In a uPNP client, search using the criteria <code>upnp:class = \"object.container.playlistContainer\" and dc:title = \"Playlist Name\"<\/code>,<\/p>\n<p dir=\"auto\"><strong><em>Expected Results:<\/em><\/strong> Playlist matching search criteria is returned<br \/>\n<strong><em>Actual Results:<\/em><\/strong> No results are returned<\/p>\n<p dir=\"auto\"><strong><em>Investigation:<\/em><\/strong><br \/>\nFrom the Gerbera debug log, the search being executed is:<\/p>\n<p dir=\"auto\"><code>SELECT DISTINCT \"c\".\"id\", \"c\".\"ref_id\",<br \/>\n\"c\".\"parent_id\", \"c\".\"object_type\", \"c\".\"upnp_class\", \"c\".\"dc_title\",<br \/>\n\"c\".\"mime_type\" , \"c\".\"flags\", \"c\".\"part_number\", \"c\".\"track_number\",<br \/>\n\"c\".\"location\", \"c\".\"last_modified\", \"c\".\"last_updated\"<br \/>\nFROM \"mt_cds_object\" \"c\"<br \/>\nINNER JOIN \"mt_metadata\" \"m\" ON \"c\".\"id\" = \"m\".\"item_id\"<br \/>\nINNER JOIN \"grb_cds_resource\" \"re\" ON \"c\".\"id\" = \"re\".\"item_id\"<br \/>\nWHERE (LOWER(\"c\".\"upnp_class\")=LOWER('object.container.playlistContainer'))<br \/>\nAND (LOWER(\"c\".\"dc_title\")=LOWER('Playlist Name'))<br \/>\nORDER BY \"c\".\"dc_title\" ASC;<\/code><\/p>\n<p dir=\"auto\">The playlists do not have a row in the grb_cds_resource table, so the &#8220;INNER JOIN&#8221; means the query returns no records.<\/p>\n<p dir=\"auto\">I am able to work around this issue by manually inserting playlist items into the grb_cds_resource table<\/p>\n<p dir=\"auto\"><code>INSERT INTO grb_cds_resource (item_id, res_id, handlerType) VALUES (1235555,0,0);<\/code><\/p>\n<p dir=\"auto\">If I have some time, I want to test <a href=\"https:\/\/github.com\/gerbera\/gerbera\/blob\/master\/src\/database\/sql_database.cc#L395\" target=\"_blank\" rel=\"noopener\">changing join2 to be a left outer join<\/a> and see if that breaks anything.<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Playlist items are not returned from searches initiated on my uPNP client. The playlist is visible when browsing the Gerbera web UI under Playlists-&gt;All Playlists-&gt;Playlist Name and Playlists-&gt;Directories-&gt;Playlists-&gt;Playlist Name Action: In a uPNP client, search using the criteria upnp:class = &#8220;object.container.playlistContainer&#8221; and dc:title = &#8220;Playlist Name&#8221;, Expected Results: Playlist matching search criteria is returned &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63],"tags":[1562,922,1563,1564,1359,1565],"class_list":["post-8773","post","type-post","status-publish","format-standard","hentry","category-home-automation","tag-gerbera","tag-sql","tag-sqlite","tag-sqlite3","tag-upnp","tag-upnp-search"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8773"}],"version-history":[{"count":5,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8773\/revisions"}],"predecessor-version":[{"id":8779,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8773\/revisions\/8779"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}