Also show cover in search results

This commit is contained in:
Felix Häcker 2019-04-28 22:09:52 +02:00 committed by Felix Häcker
parent dc3bd094b2
commit a3b1d2571e
2 changed files with 11 additions and 2 deletions

View File

@ -33,7 +33,7 @@
],
"env" : {
"CARGO_HOME" : "/run/build/Podcasts/cargo",
"RUSTFLAGS" : "--error-format=short --remap-path-prefix =../",
"RUSTFLAGS" : "--error-format=human --remap-path-prefix =../",
"RUST_BACKTRACE" : "1"
}
},

View File

@ -96,10 +96,19 @@ impl SearchProvider {
let episode = dbqueries::get_episode_from_pk(id[1], show_id).unwrap();
let image_uri = &dbqueries::get_podcast_cover_from_id(show_id)
.map(|cover| {
cover
.image_uri()
.unwrap_or("image-x-generic-symbolic")
.to_owned()
})
.unwrap_or(String::from("image-x-generic-symbolic"));
let meta = ResultMetadata::new(
sp_id,
episode.title(),
"folder-documents-symbolic",
image_uri,
episode.description().unwrap_or(""),
);
metas.insert(0, meta);