holdings: a member of a Space publishes what they hold as room-salted album keys, sealed to the room, so "who has this" is answered while they are offline
This commit is contained in:
1 parent
08ca09586a
commit
a98c750908
12 files changed
+2955
-8
No files matched your search
@@ -811,6 +811,14 @@ impl Library {
|
||||
Ok(rows.filter_map(|r| r.ok()).collect())
|
||||
}
|
||||
|
||||
/// Album id → MusicBrainz release id, for the albums that have one.
|
||||
pub fn album_mbids(&self) -> Result<std::collections::BTreeMap<i64, String>> {
|
||||
let conn = self.conn.lock().unwrap();
|
||||
let mut stmt = conn.prepare("SELECT id, mbid FROM albums WHERE mbid IS NOT NULL AND mbid != ''")?;
|
||||
let rows = stmt.query_map([], |r| Ok((r.get::<_, i64>(0)?, r.get::<_, String>(1)?)))?;
|
||||
Ok(rows.filter_map(|r| r.ok()).collect())
|
||||
}
|
||||
|
||||
/// Per-album aggregates for the Library page: what the FILES add up to.
|
||||
/// One call for the whole library, because the page derives its stat row,
|
||||
/// its Format grouping and four of its sorts (length, size, bitrate,
|
||||
|
||||
Reference in new issue
Block a user