EpisodeModels: Remove unused methods.

This commit is contained in:
Jordan Petridis 2018-07-30 23:20:10 +03:00
parent 3496df24f8
commit cc0caff8d0
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6

View File

@ -53,11 +53,6 @@ impl Episode {
&self.title &self.title
} }
/// Set the `title`.
pub fn set_title(&mut self, value: &str) {
self.title = value.to_string();
}
/// Get the value of the `uri`. /// Get the value of the `uri`.
/// ///
/// Represents the url(usually) that the media file will be located at. /// 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()) 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`. /// Get the value of the `local_uri`.
/// ///
/// Represents the local uri,usually filesystem path, /// Represents the local uri,usually filesystem path,
@ -78,31 +68,16 @@ impl Episode {
self.local_uri.as_ref().map(|s| s.as_str()) 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`. /// Get the `description`.
pub fn description(&self) -> Option<&str> { pub fn description(&self) -> Option<&str> {
self.description.as_ref().map(|s| s.as_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`. /// Get the Episode's `guid`.
pub fn guid(&self) -> Option<&str> { pub fn guid(&self) -> Option<&str> {
self.guid.as_ref().map(|s| s.as_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. /// Get the `epoch` value.
/// ///
/// Retrieved from the rss Item publish date. /// Retrieved from the rss Item publish date.
@ -111,11 +86,6 @@ impl Episode {
self.epoch self.epoch
} }
/// Set the `epoch`.
pub fn set_epoch(&mut self, value: i32) {
self.epoch = value;
}
/// Get the `length`. /// Get the `length`.
/// ///
/// The number represents the size of the file in bytes. /// The number represents the size of the file in bytes.
@ -123,11 +93,6 @@ impl Episode {
self.length self.length
} }
/// Set the `length`.
pub fn set_length(&mut self, value: Option<i32>) {
self.length = value;
}
/// Get the `duration` value. /// Get the `duration` value.
/// ///
/// The number represents the duration of the item/episode in seconds. /// The number represents the duration of the item/episode in seconds.
@ -135,11 +100,6 @@ impl Episode {
self.duration self.duration
} }
/// Set the `duration`.
pub fn set_duration(&mut self, value: Option<i32>) {
self.duration = value;
}
/// Epoch representation of the last time the episode was played. /// Epoch representation of the last time the episode was played.
/// ///
/// None/Null for unplayed. /// None/Null for unplayed.
@ -147,22 +107,10 @@ impl Episode {
self.played self.played
} }
/// Set the `played` value.
pub fn set_played(&mut self, value: Option<i32>) {
self.played = value;
}
/// `Show` table foreign key. /// `Show` table foreign key.
pub fn show_id(&self) -> i32 { pub fn show_id(&self) -> i32 {
self.show_id 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)] #[derive(Queryable, AsChangeset, PartialEq)]
@ -275,11 +223,6 @@ impl EpisodeWidgetModel {
self.duration self.duration
} }
/// Set the `duration`.
pub fn set_duration(&mut self, value: Option<i32>) {
self.duration = value;
}
/// Epoch representation of the last time the episode was played. /// Epoch representation of the last time the episode was played.
/// ///
/// None/Null for unplayed. /// None/Null for unplayed.
@ -288,7 +231,7 @@ impl EpisodeWidgetModel {
} }
/// Set the `played` value. /// Set the `played` value.
pub fn set_played(&mut self, value: Option<i32>) { fn set_played(&mut self, value: Option<i32>) {
self.played = value; self.played = value;
} }
@ -447,11 +390,6 @@ impl EpisodeMinimal {
self.length self.length
} }
/// Set the `length`.
pub fn set_length(&mut self, value: Option<i32>) {
self.length = value;
}
/// Get the `duration` value. /// Get the `duration` value.
/// ///
/// The number represents the duration of the item/episode in seconds. /// The number represents the duration of the item/episode in seconds.