Skip to content

Commit

Permalink
refactor: rename bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
kKaskak committed Oct 3, 2024
1 parent 18c06a1 commit 698c83e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
26 changes: 13 additions & 13 deletions src/models/streaming_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct Selected {
pub struct StreamingServer {
pub selected: Selected,
pub settings: Loadable<Settings, EnvError>,
pub base_url_bucket: ServerUrlBucket,
pub server_urls_bucket: ServerUrlBucket,
pub remote_url: Option<Url>,
pub playback_devices: Loadable<Vec<PlaybackDevice>, EnvError>,
pub network_info: Loadable<NetworkInfo, EnvError>,
Expand All @@ -69,7 +69,7 @@ impl StreamingServer {
statistics: None,
},
settings: Loadable::Loading,
base_url_bucket: ServerUrlBucket::new(
server_urls_bucket: ServerUrlBucket::new(
profile.uid().to_owned(),
profile.settings.streaming_server_url.to_owned(),
),
Expand All @@ -92,8 +92,8 @@ impl<E: Env + 'static> UpdateWithCtx<E> for StreamingServer {
let settings_effects = eq_update(&mut self.settings, Loadable::Loading);
let network_info_effects = eq_update(&mut self.network_info, Loadable::Loading);
let device_info_effects = eq_update(&mut self.device_info, Loadable::Loading);
let base_url_bucket_effects = eq_update(
&mut self.base_url_bucket,
let server_urls_bucket_effects = eq_update(
&mut self.server_urls_bucket,
ServerUrlBucket::new(
ctx.profile.uid().to_owned(),
ctx.profile.settings.streaming_server_url.to_owned(),
Expand All @@ -110,7 +110,7 @@ impl<E: Env + 'static> UpdateWithCtx<E> for StreamingServer {
.join(settings_effects)
.join(network_info_effects)
.join(device_info_effects)
.join(base_url_bucket_effects)
.join(server_urls_bucket_effects)
.join(remote_url_effects)
}
Msg::Action(Action::StreamingServer(ActionStreamingServer::UpdateSettings(
Expand Down Expand Up @@ -239,7 +239,7 @@ impl<E: Env + 'static> UpdateWithCtx<E> for StreamingServer {
self.settings = Loadable::Loading;
self.network_info = Loadable::Loading;
self.device_info = Loadable::Loading;
self.base_url_bucket = ServerUrlBucket::new(
self.server_urls_bucket = ServerUrlBucket::new(
ctx.profile.uid().to_owned(),
ctx.profile.settings.streaming_server_url.to_owned(),
);
Expand All @@ -262,8 +262,8 @@ impl<E: Env + 'static> UpdateWithCtx<E> for StreamingServer {
&mut self.settings,
Loadable::Ready(settings.values.to_owned()),
);
let base_url_bucket_effects = eq_update(
&mut self.base_url_bucket,
let server_urls_bucket_effects = eq_update(
&mut self.server_urls_bucket,
ServerUrlBucket::new(
ctx.profile.uid().to_owned(),
self.selected.transport_url.to_owned(),
Expand All @@ -276,12 +276,12 @@ impl<E: Env + 'static> UpdateWithCtx<E> for StreamingServer {
ctx,
);
settings_effects
.join(base_url_bucket_effects)
.join(server_urls_bucket_effects)
.join(remote_url_effects)
}
Err(error) => {
let base_url_bucket_effects = eq_update(
&mut self.base_url_bucket,
let server_urls_bucket_effects = eq_update(
&mut self.server_urls_bucket,
ServerUrlBucket::new(
ctx.profile.uid().to_owned(),
self.selected.transport_url.to_owned(),
Expand All @@ -297,7 +297,7 @@ impl<E: Env + 'static> UpdateWithCtx<E> for StreamingServer {
let settings_effects =
eq_update(&mut self.settings, Loadable::Err(error.to_owned()));
let torrent_effects = eq_update(&mut self.torrent, None);
base_url_bucket_effects
server_urls_bucket_effects
.join(remote_url_effects)
.join(playback_devices_effects)
.join(network_info_effects)
Expand Down Expand Up @@ -351,7 +351,7 @@ impl<E: Env + 'static> UpdateWithCtx<E> for StreamingServer {
Ok(_) => Effects::none().unchanged(),
Err(error) => {
let base_url_effects = eq_update(
&mut self.base_url_bucket,
&mut self.server_urls_bucket,
ServerUrlBucket::new(
ctx.profile.uid().to_owned(),
self.selected.transport_url.to_owned(),
Expand Down
6 changes: 3 additions & 3 deletions stremio-core-web/src/model/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl WebModel {
&self.continue_watching_preview,
&self.ctx.streams,
self.streaming_server
.base_url_bucket
.server_urls_bucket
.selected_item_url()
.as_ref(),
&self.ctx.profile.settings,
Expand All @@ -147,7 +147,7 @@ impl WebModel {
&self.library,
&self.ctx,
self.streaming_server
.base_url_bucket
.server_urls_bucket
.selected_item_url()
.as_ref(),
"library".to_owned(),
Expand All @@ -156,7 +156,7 @@ impl WebModel {
&self.continue_watching,
&self.ctx,
self.streaming_server
.base_url_bucket
.server_urls_bucket
.selected_item_url()
.as_ref(),
"continuewatching".to_owned(),
Expand Down
2 changes: 1 addition & 1 deletion stremio-core-web/src/model/serialize_discover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ pub fn serialize_discover(
deep_links: StreamDeepLinks::from((
stream,
&streaming_server
.base_url_bucket
.server_urls_bucket
.selected_item_url(),
&ctx.profile.settings,
))
Expand Down
8 changes: 4 additions & 4 deletions stremio-core-web/src/model/serialize_meta_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ pub fn serialize_meta_details<E: Env + 'static>(
deep_links: VideoDeepLinks::from((
video,
request,
&streaming_server.base_url_bucket.selected_item_url(),
&streaming_server.server_urls_bucket.selected_item_url(),
&ctx.profile.settings,
))
.into_web_deep_links(),
Expand All @@ -184,7 +184,7 @@ pub fn serialize_meta_details<E: Env + 'static>(
progress: None,
deep_links: StreamDeepLinks::from((
stream,
&streaming_server.base_url_bucket.selected_item_url(),
&streaming_server.server_urls_bucket.selected_item_url(),
&ctx.profile.settings,
))
.into_web_deep_links(),
Expand Down Expand Up @@ -258,7 +258,7 @@ pub fn serialize_meta_details<E: Env + 'static>(
StreamDeepLinks::from((
stream,
&streaming_server
.base_url_bucket
.server_urls_bucket
.selected_item_url(),
&ctx.profile.settings,
))
Expand All @@ -269,7 +269,7 @@ pub fn serialize_meta_details<E: Env + 'static>(
request,
&meta_item.request,
&streaming_server
.base_url_bucket
.server_urls_bucket
.selected_item_url(),
&ctx.profile.settings,
))
Expand Down
6 changes: 3 additions & 3 deletions stremio-core-web/src/model/serialize_player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub fn serialize_player<E: stremio_core::runtime::Env + 'static>(
stream: &selected.stream,
deep_links: StreamDeepLinks::from((
&selected.stream,
&streaming_server.base_url_bucket.selected_item_url(),
&streaming_server.server_urls_bucket.selected_item_url(),
&ctx.profile.settings,
))
.into_web_deep_links(),
Expand Down Expand Up @@ -150,7 +150,7 @@ pub fn serialize_player<E: stremio_core::runtime::Env + 'static>(
deep_links: VideoDeepLinks::from((
video,
request,
&streaming_server.base_url_bucket.selected_item_url(),
&streaming_server.server_urls_bucket.selected_item_url(),
&ctx.profile.settings,
))
.into_web_deep_links(),
Expand Down Expand Up @@ -231,7 +231,7 @@ pub fn serialize_player<E: stremio_core::runtime::Env + 'static>(
video,
stream_request,
meta_request,
&streaming_server.base_url_bucket.selected_item_url(),
&streaming_server.server_urls_bucket.selected_item_url(),
&ctx.profile.settings,
))
.into_web_deep_links(),
Expand Down
4 changes: 2 additions & 2 deletions stremio-core-web/src/model/serialize_streaming_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod model {
pub struct StreamingServer<'a> {
pub selected: &'a Selected,
pub settings: &'a Loadable<Settings, EnvError>,
pub base_url_bucket: &'a ServerUrlBucket,
pub server_urls_bucket: &'a ServerUrlBucket,
pub remote_url: &'a Option<Url>,
pub playback_devices: &'a Loadable<Vec<PlaybackDevice>, EnvError>,
pub network_info: &'a Loadable<NetworkInfo, EnvError>,
Expand All @@ -39,7 +39,7 @@ pub fn serialize_streaming_server(
<JsValue as JsValueSerdeExt>::from_serde(&model::StreamingServer {
selected: &streaming_server.selected,
settings: &streaming_server.settings,
base_url_bucket: &streaming_server.base_url_bucket,
server_urls_bucket: &streaming_server.server_urls_bucket,
remote_url: &streaming_server.remote_url,
playback_devices: &streaming_server.playback_devices,
network_info: &streaming_server.network_info,
Expand Down

0 comments on commit 698c83e

Please sign in to comment.