package Ġcom . sample . music x . data Ċ Ċ import Ġcom . sample . music x . model . Album Ċ import Ġkotlinx . coroutines . Dispatch ers . IO Ċ import Ġkotlinx . coroutines . with Context Ċ Ċ class ĠAlbum Repository Ġprivate Ġconstructor ( private Ġval Ġalbum Dao : ĠAlbum Dao ) Ġ{ ĊĊĠĠĠ Ġfun Ġget Album s () Ġ= Ġalbum Dao . get Album s () ĊĊĠĠĠ Ġsuspend Ġfun Ġinsert All ( albums : ĠList < Album >) Ġ{ ĊĠĠĠĠĠĠĠ Ġwith Context ( IO ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġalbum Dao . insert All ( albums ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġinstance : ĠAlbum Repository ? Ġ= Ġnull ĊĊĠĠĠĠĠĠĠ Ġfun ĠgetInstance ( album Dao : ĠAlbum Dao ) Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġinstance Ġ?: ĠAlbum Repository ( album Dao ). also Ġ{ Ġinstance Ġ= Ġit Ġ} ĊĠĠĠ Ġ} Ċ }