aboutsummaryrefslogtreecommitdiff
path: root/import/src/plugins/infojson.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-01-24 23:06:33 +0100
committermetamuffin <metamuffin@disroot.org>2026-01-24 23:06:33 +0100
commit2bcccb18a6cb8bf836f57c3d86f759b19699def2 (patch)
treeef55a10c6d9703677a983b8ca900fb4578a08eb3 /import/src/plugins/infojson.rs
parentb2e88a8beabf04adc28947cf82996e8692a68b71 (diff)
downloadjellything-2bcccb18a6cb8bf836f57c3d86f759b19699def2.tar
jellything-2bcccb18a6cb8bf836f57c3d86f759b19699def2.tar.bz2
jellything-2bcccb18a6cb8bf836f57c3d86f759b19699def2.tar.zst
cache as object
Diffstat (limited to 'import/src/plugins/infojson.rs')
-rw-r--r--import/src/plugins/infojson.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/import/src/plugins/infojson.rs b/import/src/plugins/infojson.rs
index d62983d..3426679 100644
--- a/import/src/plugins/infojson.rs
+++ b/import/src/plugins/infojson.rs
@@ -3,16 +3,10 @@
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2026 metamuffin <metamuffin.org>
*/
-use crate::plugins::{PluginContext, ImportPlugin, PluginInfo};
+use crate::plugins::{ImportPlugin, PluginContext, PluginInfo};
use anyhow::{Context, Result, anyhow};
use chrono::{Utc, format::Parsed};
-use jellycache::cache_read;
-use jellycommon::{
- IDENT_BANDCAMP, IDENT_YOUTUBE_CHANNEL, IDENT_YOUTUBE_CHANNEL_HANDLE, IDENT_YOUTUBE_VIDEO,
- KIND_CHANNEL, KIND_MUSIC, KIND_SHORTFORMVIDEO, KIND_VIDEO, NO_DESCRIPTION, NO_IDENTIFIERS,
- NO_KIND, NO_RATINGS, NO_RELEASEDATE, NO_SUBTITLE, NO_TAG, NO_TITLE, RTYP_YOUTUBE_FOLLOWERS,
- RTYP_YOUTUBE_LIKES, RTYP_YOUTUBE_VIEWS,
-};
+use jellycommon::*;
use jellydb::table::RowNum;
use jellyremuxer::matroska::{AttachedFile, Segment};
use log::info;
@@ -215,7 +209,10 @@ impl ImportPlugin for Infojson {
.flat_map(|a| &a.files)
.find(is_info_json)
.map(|att| {
- let data = cache_read(str::from_utf8(&att.data).unwrap())?
+ let data = ct
+ .dba
+ .cache
+ .read(str::from_utf8(&att.data).unwrap())?
.ok_or(anyhow!("info json cache missing"))?;
anyhow::Ok(serde_json::from_slice::<YVideo>(&data)?)
})