From cc0caff8d07ab1b7e104b51fe0bf6b3994531b6a Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Mon, 30 Jul 2018 23:20:10 +0300 Subject: [PATCH] EpisodeModels: Remove unused methods. --- podcasts-data/src/models/episode.rs | 64 +---------------------------- 1 file changed, 1 insertion(+), 63 deletions(-) diff --git a/podcasts-data/src/models/episode.rs b/podcasts-data/src/models/episode.rs index 2d31887..5028888 100644 --- a/podcasts-data/src/models/episode.rs +++ b/podcasts-data/src/models/episode.rs @@ -53,11 +53,6 @@ impl Episode { &self.title } - /// Set the `title`. - pub fn set_title(&mut self, value: &str) { - self.title = value.to_string(); - } - /// Get the value of the `uri`. /// /// Represents the url(usually) that the media file will be located at. @@ -65,11 +60,6 @@ impl Episode { self.uri.as_ref().map(|s| s.as_str()) } - /// Set the `uri`. - pub fn set_uri(&mut self, value: Option<&str>) { - self.uri = value.map(|x| x.to_string()); - } - /// Get the value of the `local_uri`. /// /// Represents the local uri,usually filesystem path, @@ -78,31 +68,16 @@ impl Episode { self.local_uri.as_ref().map(|s| s.as_str()) } - /// Set the `local_uri`. - pub fn set_local_uri(&mut self, value: Option<&str>) { - self.local_uri = value.map(|x| x.to_string()); - } - /// Get the `description`. pub fn description(&self) -> Option<&str> { self.description.as_ref().map(|s| s.as_str()) } - /// Set the `description`. - pub fn set_description(&mut self, value: Option<&str>) { - self.description = value.map(|x| x.to_string()); - } - /// Get the Episode's `guid`. pub fn guid(&self) -> Option<&str> { self.guid.as_ref().map(|s| s.as_str()) } - /// Set the `guid`. - pub fn set_guid(&mut self, value: Option<&str>) { - self.guid = value.map(|x| x.to_string()); - } - /// Get the `epoch` value. /// /// Retrieved from the rss Item publish date. @@ -111,11 +86,6 @@ impl Episode { self.epoch } - /// Set the `epoch`. - pub fn set_epoch(&mut self, value: i32) { - self.epoch = value; - } - /// Get the `length`. /// /// The number represents the size of the file in bytes. @@ -123,11 +93,6 @@ impl Episode { self.length } - /// Set the `length`. - pub fn set_length(&mut self, value: Option) { - self.length = value; - } - /// Get the `duration` value. /// /// The number represents the duration of the item/episode in seconds. @@ -135,11 +100,6 @@ impl Episode { self.duration } - /// Set the `duration`. - pub fn set_duration(&mut self, value: Option) { - self.duration = value; - } - /// Epoch representation of the last time the episode was played. /// /// None/Null for unplayed. @@ -147,22 +107,10 @@ impl Episode { self.played } - /// Set the `played` value. - pub fn set_played(&mut self, value: Option) { - self.played = value; - } - /// `Show` table foreign key. pub fn show_id(&self) -> i32 { self.show_id } - - /// Sets the `played` value with the current `epoch` timestap and save it. - pub fn set_played_now(&mut self) -> Result<(), DataError> { - let epoch = Utc::now().timestamp() as i32; - self.set_played(Some(epoch)); - self.save().map(|_| ()) - } } #[derive(Queryable, AsChangeset, PartialEq)] @@ -275,11 +223,6 @@ impl EpisodeWidgetModel { self.duration } - /// Set the `duration`. - pub fn set_duration(&mut self, value: Option) { - self.duration = value; - } - /// Epoch representation of the last time the episode was played. /// /// None/Null for unplayed. @@ -288,7 +231,7 @@ impl EpisodeWidgetModel { } /// Set the `played` value. - pub fn set_played(&mut self, value: Option) { + fn set_played(&mut self, value: Option) { self.played = value; } @@ -447,11 +390,6 @@ impl EpisodeMinimal { self.length } - /// Set the `length`. - pub fn set_length(&mut self, value: Option) { - self.length = value; - } - /// Get the `duration` value. /// /// The number represents the duration of the item/episode in seconds.