Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fn to sum albums/songs with different capitalizations #65

Closed
fsktom opened this issue Aug 5, 2023 · 10 comments
Closed

Fn to sum albums/songs with different capitalizations #65

fsktom opened this issue Aug 5, 2023 · 10 comments
Assignees
Labels
cli Regarding `endsong_ui` crate enhancement New feature or request library Regarding `endsong` crate

Comments

@fsktom
Copy link
Owner

fsktom commented Aug 5, 2023

something like
pub fn sum_diff_capitalization(&mut self)

Adjacent to #2

e.g. look at

Artist name?
  >> Survive Said The Prophet
Survive Said The Prophet | 4863 plays
    Fixed | 1253 plays
        Let it die | 204 plays
        Just so you know | 188 plays
        Bandaid | 160 plays
        Fool's gold | 158 plays
        Follow | 151 plays
        Spectrum | 128 plays
        Tierra | 109 plays
        I don't care | 106 plays
        FRAGMENT | 25 plays
        FIXED | 24 plays
    s p a c e [ s ] | 1103 plays
        NE:ONE | 296 plays
        s t i l l b e l i e v e | 185 plays
        found & lost | 168 plays
        Right and Left | 103 plays
        The Happy Song | 103 plays
        T R A N S l a t e d | 101 plays
        S P I N E | 73 plays
        UPLIFTED | 71 plays
        p a c e s [ s ] | 2 plays
        s p a c e [ s ] | 1 plays
    Inside Your Head | 747 plays
        Your Head | 95 plays
        3 A.M. | 76 plays
        Bridges | 76 plays
        Heroine | 76 plays
        Inside | 73 plays
        Never; Saying Never | 70 plays
        Calm:Unison | 69 plays
        Last Dance Lullaby | 66 plays
        03:01 | 64 plays
        Hero | 64 plays
        Mukanjyo | 9 plays
        red | 9 plays
    Wabi Sabi | 551 plays
        Network System | 91 plays
        When I | 88 plays
        Conscious | 83 plays
        Again | 75 plays
        Listening | 75 plays
        [ ] | 69 plays
        Lost in Time | 68 plays
        SABI | 1 plays
        WABI | 1 plays
    Red | 285 plays
        RED | 200 plays
        lost & found | 83 plays
        RED - Instrumental- | 2 plays
    Course Of Action | 242 plays
        Awake You Ask Kinda Awkwardly | 50 plays
        Subtraction | 50 plays
        MIRROR | 43 plays
        Course Of Action | 21 plays
        Escape | 20 plays
        If You Really Want To | 20 plays
        Innocence In The Name Of Love | 20 plays
        Ashes, Ashes | 18 plays
    FIXED | 200 plays
        Just so you know | 30 plays
        Let it die | 26 plays
        Tierra | 24 plays
        Fool's gold | 23 plays
        I don't care | 22 plays
        Bandaid | 18 plays
        Follow | 18 plays
        Spectrum | 18 plays
        FIXED | 14 plays
        FRAGMENT | 7 plays
    Mukanjyo | 138 plays
        MUKANJYO | 138 plays
    Ne:one / Hi l Lo | 108 plays
        HI l LO | 107 plays
        Conscious -"WABI SABI TOUR 2017 FINAL" LIVE Ver.- | 1 plays
    Beauty Queen | 56 plays
        Beauty Queen | 56 plays
    WABI SABI | 55 plays
        Conscious | 13 plays
        Listening | 8 plays
        Network System | 8 plays
        Again | 7 plays
        When I | 7 plays
        [ ] | 7 plays
        Lost in Time | 5 plays
    RED | 39 plays
        RED | 20 plays
        lost & found | 19 plays
    Paradox | 23 plays
        Paradox | 16 plays
        Find You | 4 plays
        Paradox - Acoustic | 2 plays
        Mukanjyo - Acoustic | 1 plays
    Win / Lose | 14 plays
        Win / Lose | 14 plays
    MUKANJYO | 12 plays
        MUKANJYO | 12 plays
    Papersky | 10 plays
        Papersky | 10 plays
    Hateful Failures | 8 plays
        624 | 1 plays
        Beauty Queen | 1 plays
        Drive Far | 1 plays
        Hateful Failures Pt.1 | 1 plays
        Hateful Failures Pt.2 | 1 plays
        Hopelessly young | 1 plays
        Mary | 1 plays
        Papersky | 1 plays
    NE:ONE / HI l LO (Special Edition) | 8 plays
        HI l LO | 8 plays
    Papersky l Win / Lose | 8 plays
        Papersky | 3 plays
        Win / Lose | 3 plays
        Papersky - Instrumental | 2 plays
    Mary | 2 plays
        Mary | 2 plays
    Common Sense | 1 plays
        Heroine | 1 plays

There's e.g. FIXED and Fixed (so same albums with different capitalizations)

or for Sabaton - Primo Victoria

Sabaton - Primo Victoria | 311 plays
    Counterstrike | 94 plays
    Primo Victoria | 89 plays
    Stalingrad | 82 plays
    Metal Machine | 23 plays
    Panzer Battalion | 20 plays
    Into The Fire | 1 plays
    Into the Fire | 1 plays
    Wolfpack | 1 plays

Into The Fire and Into the Fire (same songs in the album with different capitalizations)

I think this can happen if the artist/Spotify changes it at some point in time
Or creates a new album (with different spotify id - haven't checked that yet) that replaces the old one
But the song entries are still saved from the previous one

Would be nice to have a function that merges albums (from the same artist) and songs (from the same album) with different capitalizations. And takes the capitalization from either the most played one or the most recently played on. I'm not sure yet, but I'm tending toward the latter.

@fsktom fsktom added enhancement New feature or request library Regarding `endsong` crate labels Aug 5, 2023
@fsktom fsktom self-assigned this Aug 5, 2023
@fsktom fsktom pinned this issue Aug 5, 2023
@fsktom
Copy link
Owner Author

fsktom commented Aug 7, 2023

Maybe also a way to sum stuff with (Deluxe Version) or (nth Anniversary Edition) in the name?

Or would it be too cumbersome?

@fsktom
Copy link
Owner Author

fsktom commented Aug 11, 2023

Just look at this...
image

fsktom added a commit that referenced this issue Aug 12, 2023
@fsktom
Copy link
Owner Author

fsktom commented Aug 12, 2023

While doing this....
I saw the insanity that is Carolus Rex from Sabaton
this album has an English and Swedish version....

I've been listening to it since 2016
and these are all albums named Carolus Rex in my listening history according to print artist (after running sum_different_capitalization() and filter(30, Duration::seconds(10)) on endsong_0 through 9:

  • Carolus Rex | 359 plays
  • Carolus Rex (English Version) | 268 plays
  • Carolus Rex (English) | 59 plays
  • Carolus Rex (Swedish Version) | 10 plays
  • Carolus Rex (Swedish) | 3 plays

xd

The ones in my Sabaton playlist are from Carolus Rex
image
image

But when you search for Carolus Rex (and on the Sabaton artist page)
there's only Carolus Rex (English) and Carolus Rex (Swedish)
image
image
The plays on these albums are summed plays from the songs from all previous album versions it seems.
But obviously not in my listening history xd :(

@fsktom
Copy link
Owner Author

fsktom commented Aug 12, 2023

Maybe also...
if the same song appears in different albums (maybe with diff capitalization)
put that song in the album with the most recent plays?

fsktom added a commit that referenced this issue Aug 12, 2023
@fsktom
Copy link
Owner Author

fsktom commented Aug 12, 2023

^I thought using Artist, Album, Song would make it slower
but nah
after benchmarking it, it runs for basically the same amount of time (though I only tested it on endsong_0.json)
even though I'm also cloning each entry :D (but I guess it's bc Duration and DateTime<Local> implement Copy, Rc<str> clone is O(1) and the only heavy thing to clone is the String for the Spotify URI (which I never use....))

@fsktom
Copy link
Owner Author

fsktom commented Aug 14, 2023

Maybe also... if the same song appears in different albums (maybe with diff capitalization) put that song in the album with the most recent plays?

well print::top already has sum_songs_from_different_albums argument
I could probably add this to print::aspect somehow...

@fsktom
Copy link
Owner Author

fsktom commented Aug 25, 2023

^Issues with songs like Intro or Outro that are likely to be in multiple albums, but are actually different songs

fsktom added a commit that referenced this issue Aug 16, 2024
I think some days/weeks ago maybe in a Primeagen video I heard
about having a boolean switch like this being bad.
I can't remember it very well, if I do I'll post it in the issue/comment
But I agree, and I didn't like this solution. I think this is much
better.
I also added summing song plays across albums for plotting top songs.
@fsktom
Copy link
Owner Author

fsktom commented Aug 19, 2024

To avoid issues with songs like Intro, I'm not gonna make a function to change the SongEntries themselves. I think the way it's done in a95818c is fine -> decide at each prompt/function call if you want the plays summed across albums or not.

In regards to print::aspect: let it be

Also, I noticed this issue isn't actually about same song name across albums, but diff capitalization xd :) :) :)

@fsktom
Copy link
Owner Author

fsktom commented Aug 19, 2024

The current issue is that if you don't do .sum_different_capitalization() you can't get a specific version in the prompt bc of .to_lowercase().

I've found 3 songs named MUKANJYO from Survive Said The Prophet with a total of 127 plays!
Survive Said The Prophet - MUKANJYO (Mukanjyo) | 106 plays
Survive Said The Prophet - Mukanjyo (Inside Your Head) | 9 plays
Survive Said The Prophet - MUKANJYO (MUKANJYO) | 12 plays
>>> print song
Artist name?
  >> survive said the prophet
Album name?
  >> mukanjy
MUKANJYO  Mukanjyo
  >> mukanjyo
Song name?
  >> mukanjyo
Survive Said The Prophet - MUKANJYO (Mukanjyo) | 106 plays
>>> print song
Artist name?
  >> Survive Said The Prophet
Album name?
  >> MUKANJYO
Song name?
  >> MUKANJYO
Survive Said The Prophet - MUKANJYO (Mukanjyo) | 106 plays
>>>

@fsktom fsktom added the cli Regarding `endsong_ui` crate label Aug 19, 2024
@fsktom
Copy link
Owner Author

fsktom commented Aug 19, 2024

Probably also same issue with two albums or even artists with same name but different capitalization...

Seems like it's already been mentioned in #2 a while ago... And I've already searched for artists that would match this criterion XD #2 (comment) I wanted to do it now, but forgot I had already done it heh

But now it all comes back

So I'm gonna continue this in in #2.

@fsktom fsktom closed this as completed Aug 19, 2024
@fsktom fsktom unpinned this issue Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Regarding `endsong_ui` crate enhancement New feature or request library Regarding `endsong` crate
Projects
None yet
Development

No branches or pull requests

1 participant