package Ġuk . co . sentinel web . c uer . app . db . dao Ċ Ċ import Ġandroidx . room .* Ċ import Ġuk . co . sentinel web . c uer . app . db . entity . Playlist And Items Ċ import Ġuk . co . sentinel web . c uer . app . db . entity . Playlist Entity Ċ Ċ @ Dao Ċ interface ĠPlaylist Dao Ġ{ ĊĊĠĠĠ Ġ@ Query (" SELECT Ġcount () ĠFROM Ġplaylist ") ĊĠĠĠ Ġsuspend Ġfun Ġcount (): ĠInt ĊĊĠĠĠ Ġ@ Query (" SELECT Ġcount () ĠFROM Ġplaylist ") ĊĠĠĠ Ġsuspend Ġfun Ġcount Items (): ĠInt ĊĊĠĠĠ Ġ//@ Transaction ĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġplaylist ") ĊĠĠĠ Ġsuspend Ġfun ĠgetAll Play lists With Items (): ĠList < Playlist And Items > ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġplaylist ") ĊĠĠĠ Ġsuspend Ġfun ĠgetAll Play lists (): ĠList < Playlist Entity > ĊĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġsuspend Ġfun Ġinsert All ( play lists : ĠList < Playlist Entity >): ĠList < Long > ĊĊĠĠĠ Ġ@ Insert ( on Conflict Ġ= ĠOn Conflict Strategy . REPLACE ) ĊĠĠĠ Ġsuspend Ġfun Ġinsert ( playlist : ĠPlaylist Entity ): ĠLong ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġplaylist ĠWHERE Ġid Ġ== Ġ: id ") ĊĠĠĠ Ġsuspend Ġfun Ġload ( id : ĠLong ): ĠPlaylist Entity ? ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġplaylist ĠWHERE Ġid ĠIN Ġ(: playlist Ids )") ĊĠĠĠ Ġsuspend Ġfun Ġload All ById s ( playlist Ids : ĠLong Array ): ĠList < Playlist Entity > ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġplaylist ĠWHERE Ġplatform _ id ĠIN Ġ(: platform Ids )") ĊĠĠĠ Ġsuspend Ġfun Ġload All By Platform Ids ( platform Ids : ĠList < String >): ĠList < Playlist Entity > ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġplaylist ĠWHERE Ġflags Ġ& Ġ: flags Ġ== Ġ: flags ") ĊĠĠĠ Ġsuspend Ġfun Ġload All By Flags ( flags : ĠLong ): ĠList < Playlist Entity > ĊĊĠĠĠ Ġ//@ Transaction ĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġplaylist ĠWHERE Ġid Ġ== Ġ: id ") ĊĠĠĠ Ġsuspend Ġfun Ġload With Items ( id : ĠLong ): ĠPlaylist And Items ? ĊĊĠĠĠ Ġ//@ Transaction ĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġplaylist ĠWHERE Ġid ĠIN Ġ(: playlist Ids )") ĊĠĠĠ Ġsuspend Ġfun Ġload All ById sWith Items ( playlist Ids : ĠLong Array ): ĠList < Playlist And Items > ĊĊĠĠĠ Ġ//@ Transaction ĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġplaylist ĠWHERE Ġplatform _ id ĠIN Ġ(: platform Ids )") ĊĠĠĠ Ġsuspend Ġfun Ġload All By Platform Ids With Items ( platform Ids : ĠList < String >): ĠList < Playlist And Items > ĊĊĠĠĠ Ġ//@ Transaction ĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġplaylist ĠWHERE Ġflags Ġ& Ġ: flags Ġ== Ġ: flags ") ĊĠĠĠ Ġsuspend Ġfun Ġload All By Flags With Items ( flags : ĠLong ): ĠList < Playlist And Items > ĊĊĠĠĠ Ġ@ Query (" UPDATE Ġplaylist ĠSET ĠcurrentIndex =: index ĠWHERE Ġid =: id ") ĊĠĠĠ Ġsuspend Ġfun Ġupdate Index ( id : ĠLong , Ġindex : ĠInt ): ĠInt ĊĊĠĠĠ Ġ// Ġtodo Ġcan Ġmake Ġpartial Ġupdates Ġentities Ġfor Ġfields ĊĠĠĠ Ġ// Ġhttps :// stackoverflow . com / questions / 4 5 7 8 9 3 2 5 / update - some - specific - field - of - an - entity - in - android - room / 5 9 8 3 4 3 0 9 # 5 9 8 3 4 3 0 9 ĊĠĠĠ Ġ@ Update ĊĠĠĠ Ġsuspend Ġfun Ġupdate ( playlist : ĠPlaylist Entity ): ĠInt ĊĊĠĠĠ Ġ@ Delete ĊĠĠĠ Ġsuspend Ġfun Ġdelete ( playlist : ĠPlaylist Entity ) ĊĊĠĠĠ Ġ@ Query (" DELETE ĠFROM Ġplaylist ") ĊĠĠĠ Ġsuspend Ġfun Ġdelete All () ĊĊĠĠĠ Ġ@ Query (" select Ġdistinct Ġplaylist .* Ġfrom Ġplaylist , Ġplaylist _ item , Ġmedia , Ġchannel Ġwhere Ġplaylist . id == playlist _ item . playlist _ id Ġand Ġplaylist _ item . media _ id == media . id Ġand Ġmedia . channel _ id == channel . id Ġand Ġchannel . remote _ id =: channelId ") ĊĠĠĠ Ġsuspend Ġfun Ġfind Play lists For Chan ne Platform l Id ( channelId : ĠString ): ĠList < Playlist Entity > ĊĊĠĠĠ Ġ@ Query (" SELECT Ġ* ĠFROM Ġplaylist ĠWHERE ĠIN STR ( LOWER ( title ), ĠLOWER (: title )) ") ĊĠĠĠ Ġsuspend Ġfun Ġfind Play lists With Title ( title : ĠString ): ĠList < Playlist Entity > Ċ }