ScrobbleEdit

Struct ScrobbleEdit 

Source
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: String

Original 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: String

New 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: bool

Whether 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

Source

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 scrobble
  • album_name_original - The current album name in the scrobble
  • artist_name_original - The current artist name in the scrobble
  • album_artist_name_original - The current album artist name in the scrobble
  • track_name - The new track name to set
  • album_name - The new album name to set
  • artist_name - The new artist name to set
  • album_artist_name - The new album artist name to set
  • timestamp - Unix timestamp identifying the scrobble
  • edit_all - Whether to edit all matching scrobbles or just this one
Source

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 name
  • original_album - The current album name
  • original_artist - The current artist name
  • timestamp - Unix timestamp identifying the scrobble
Source

pub fn with_track_name(self, track_name: &str) -> Self

Set the new track name.

Source

pub fn with_album_name(self, album_name: &str) -> Self

Set the new album name.

Source

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.

Source

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.

Source

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 set
  • artist_name - The new artist name to set
  • album_name - The new album name to set
  • timestamp - Unix timestamp identifying the scrobble
Source

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)
Source

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 from
  • new_artist_name - The new artist name to change to
Source

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 edit
  • artist_name - The artist name for the album
  • new_artist_name - The new artist name to change to

Trait Implementations§

Source§

impl Clone for ScrobbleEdit

Source§

fn clone(&self) -> ScrobbleEdit

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScrobbleEdit

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ScrobbleEdit

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ScrobbleEdit

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for ScrobbleEdit

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ScrobbleEdit

Source§

fn eq(&self, other: &ScrobbleEdit) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ScrobbleEdit

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for ScrobbleEdit

Source§

impl StructuralPartialEq for ScrobbleEdit

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> ToString for T
where T: Display + ?Sized,

§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,