pub struct ScrobbleEdit {
pub track_name_original: Option<String>,
pub album_name_original: Option<String>,
pub artist_name_original: String,
pub album_artist_name_original: Option<String>,
pub track_name: Option<String>,
pub album_name: Option<String>,
pub artist_name: String,
pub album_artist_name: Option<String>,
pub timestamp: Option<u64>,
pub edit_all: bool,
}Expand description
Represents a scrobble edit operation.
This structure contains all the information needed to edit a specific scrobble on Last.fm, including both the original and new metadata values.
Fields§
§track_name_original: Option<String>Original track name as it appears in the scrobble (optional - if None, edits all tracks)
album_name_original: Option<String>Original album name as it appears in the scrobble (optional)
artist_name_original: StringOriginal artist name as it appears in the scrobble (required)
album_artist_name_original: Option<String>Original album artist name as it appears in the scrobble (optional)
track_name: Option<String>New track name to set (optional - if None, keeps original track names)
album_name: Option<String>New album name to set (optional - if None, keeps original album names)
artist_name: StringNew artist name to set
album_artist_name: Option<String>New album artist name to set (optional - if None, keeps original album artist names)
timestamp: Option<u64>Unix timestamp of the scrobble to edit (optional)
This identifies the specific scrobble instance to modify. If None, the client will attempt to find a representative timestamp.
edit_all: boolWhether to edit all instances or just this specific scrobble
When true, Last.fm will update all scrobbles with matching metadata.
When false, only this specific scrobble (identified by timestamp) is updated.
Implementations§
Source§impl ScrobbleEdit
impl ScrobbleEdit
Sourcepub fn new(
track_name_original: Option<String>,
album_name_original: Option<String>,
artist_name_original: String,
album_artist_name_original: Option<String>,
track_name: Option<String>,
album_name: Option<String>,
artist_name: String,
album_artist_name: Option<String>,
timestamp: Option<u64>,
edit_all: bool,
) -> Self
pub fn new( track_name_original: Option<String>, album_name_original: Option<String>, artist_name_original: String, album_artist_name_original: Option<String>, track_name: Option<String>, album_name: Option<String>, artist_name: String, album_artist_name: Option<String>, timestamp: Option<u64>, edit_all: bool, ) -> Self
Create a new ScrobbleEdit with all required fields.
This is the most general constructor that allows setting all fields.
For convenience, consider using from_track_info instead.
§Arguments
track_name_original- The current track name in the scrobblealbum_name_original- The current album name in the scrobbleartist_name_original- The current artist name in the scrobblealbum_artist_name_original- The current album artist name in the scrobbletrack_name- The new track name to setalbum_name- The new album name to setartist_name- The new artist name to setalbum_artist_name- The new album artist name to settimestamp- Unix timestamp identifying the scrobbleedit_all- Whether to edit all matching scrobbles or just this one
Sourcepub fn from_track_info(
original_track: &str,
original_album: &str,
original_artist: &str,
timestamp: u64,
) -> Self
pub fn from_track_info( original_track: &str, original_album: &str, original_artist: &str, timestamp: u64, ) -> Self
Create an edit request from track information (convenience constructor).
This constructor creates a ScrobbleEdit with the new values initially
set to the same as the original values. Use the builder methods like
with_track_name to specify what should be changed.
§Arguments
original_track- The current track nameoriginal_album- The current album nameoriginal_artist- The current artist nametimestamp- Unix timestamp identifying the scrobble
Sourcepub fn with_track_name(self, track_name: &str) -> Self
pub fn with_track_name(self, track_name: &str) -> Self
Set the new track name.
Sourcepub fn with_album_name(self, album_name: &str) -> Self
pub fn with_album_name(self, album_name: &str) -> Self
Set the new album name.
Sourcepub fn with_artist_name(self, artist_name: &str) -> Self
pub fn with_artist_name(self, artist_name: &str) -> Self
Set the new artist name.
This also sets the album artist name to the same value.
Sourcepub fn with_edit_all(self, edit_all: bool) -> Self
pub fn with_edit_all(self, edit_all: bool) -> Self
Set whether to edit all instances of this track.
When true, Last.fm will update all scrobbles with the same metadata.
When false (default), only the specific scrobble is updated.
Sourcepub fn with_minimal_info(
track_name: &str,
artist_name: &str,
album_name: &str,
timestamp: u64,
) -> Self
pub fn with_minimal_info( track_name: &str, artist_name: &str, album_name: &str, timestamp: u64, ) -> Self
Create an edit request with minimal information, letting the client look up missing metadata.
This constructor is useful when you only know some of the original metadata and want the client to automatically fill in missing information by looking up the scrobble.
§Arguments
track_name- The new track name to setartist_name- The new artist name to setalbum_name- The new album name to settimestamp- Unix timestamp identifying the scrobble
Sourcepub fn from_track_and_artist(track_name: &str, artist_name: &str) -> Self
pub fn from_track_and_artist(track_name: &str, artist_name: &str) -> Self
Create an edit request with just track and artist information.
This constructor is useful when you only know the track and artist names. The client will use these as both original and new values, and will attempt to find a representative timestamp and album information.
§Arguments
track_name- The track name (used as both original and new)artist_name- The artist name (used as both original and new)
Sourcepub fn for_artist(old_artist_name: &str, new_artist_name: &str) -> Self
pub fn for_artist(old_artist_name: &str, new_artist_name: &str) -> Self
Create an edit request for all tracks by an artist.
This constructor creates a ScrobbleEdit that will edit all tracks
by the specified artist, changing the artist name to the new value.
§Arguments
old_artist_name- The current artist name to change fromnew_artist_name- The new artist name to change to
Sourcepub fn for_album(
album_name: &str,
old_artist_name: &str,
new_artist_name: &str,
) -> Self
pub fn for_album( album_name: &str, old_artist_name: &str, new_artist_name: &str, ) -> Self
Create an edit request for all tracks in a specific album.
This constructor creates a ScrobbleEdit that will edit all tracks
in the specified album by the specified artist.
§Arguments
album_name- The album name containing tracks to editartist_name- The artist name for the albumnew_artist_name- The new artist name to change to
Trait Implementations§
Source§impl Clone for ScrobbleEdit
impl Clone for ScrobbleEdit
Source§fn clone(&self) -> ScrobbleEdit
fn clone(&self) -> ScrobbleEdit
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScrobbleEdit
impl Debug for ScrobbleEdit
Source§impl<'de> Deserialize<'de> for ScrobbleEdit
impl<'de> Deserialize<'de> for ScrobbleEdit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ScrobbleEdit
impl Display for ScrobbleEdit
Source§impl Hash for ScrobbleEdit
impl Hash for ScrobbleEdit
Source§impl PartialEq for ScrobbleEdit
impl PartialEq for ScrobbleEdit
Source§impl Serialize for ScrobbleEdit
impl Serialize for ScrobbleEdit
impl Eq for ScrobbleEdit
impl StructuralPartialEq for ScrobbleEdit
Auto Trait Implementations§
impl Freeze for ScrobbleEdit
impl RefUnwindSafe for ScrobbleEdit
impl Send for ScrobbleEdit
impl Sync for ScrobbleEdit
impl Unpin for ScrobbleEdit
impl UnwindSafe for ScrobbleEdit
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.