Skip to content

Commit

Permalink
refactor(core-web): use Descriptor for InstalledAddons model
Browse files Browse the repository at this point in the history
  • Loading branch information
tymmesyde committed Dec 24, 2024
1 parent a86e34d commit d27eaa8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stremio-core-web/src/model/serialize_installed_addons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod model {

use stremio_core::{
models::installed_addons_with_filters::Selected,
types::addon::{DescriptorFlags, ManifestPreview},
types::addon::{DescriptorFlags, Manifest},
};

use super::*;
Expand All @@ -20,8 +20,8 @@ mod model {
/// [`DescriptorFlags`] of an addon.
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DescriptorPreview {
pub manifest: ManifestPreview,
pub struct Descriptor<'a> {
pub manifest: &'a Manifest,
pub transport_url: Url,
#[serde(default)]
pub flags: DescriptorFlags,
Expand Down Expand Up @@ -53,7 +53,7 @@ mod model {
pub struct InstalledAddonsWithFilters<'a> {
pub selected: &'a Option<Selected>,
pub selectable: Selectable<'a>,
pub catalog: Vec<DescriptorPreview>,
pub catalog: Vec<Descriptor<'a>>,
}
}

Expand Down Expand Up @@ -89,8 +89,8 @@ pub fn serialize_installed_addons(
catalog: installed_addons
.catalog
.iter()
.map(|addon| model::DescriptorPreview {
manifest: (&addon.manifest).into(),
.map(|addon| model::Descriptor {
manifest: &addon.manifest,
transport_url: addon.transport_url.clone(),
flags: addon.flags.clone(),
installed: true,
Expand Down

0 comments on commit d27eaa8

Please sign in to comment.