fsktom / rusty-endsong-parser

Better, more performant version of https://github.com/fsktom/endsong-parser-python written in Rust
0 stars 0 forks source link

Adjust print_top. print_aspect formatting to the Python version #1

Closed fsktom closed 1 year ago

fsktom commented 2 years ago

The current one is hideous.

E.g. for albums: Currently:

=== Powerwolf - Blood of the Saints | 1134 plays ===
 #1: Powerwolf - All We Need is Blood (Blood of the Saints) | 145 plays
 #2: Powerwolf - Son of a Wolf (Blood of the Saints) | 143 plays
 #3: Powerwolf - Phantom of the Funeral (Blood of the Saints) | 141 plays
 #4: Powerwolf - Dead Boys Don't Cry (Blood of the Saints) | 132 plays
 #5: Powerwolf - We Drink Your Blood (Blood of the Saints) | 123 plays
 #6: Powerwolf - Sanctified with Dynamite (Blood of the Saints) | 120 plays
 #7: Powerwolf - Murder at Midnight (Blood of the Saints) | 106 plays
 #8: Powerwolf - Die, Die, Crucify (Blood of the Saints) | 104 plays
 #9: Powerwolf - Night of the Werewolves (Blood of the Saints) | 94 plays
#10: Powerwolf - Ira Sancti (When the Saints Are Going Wild) (Blood of the Saints) | 22 plays
#11: Powerwolf - Agnus Dei (Intro) (Blood of the Saints) | 4 plays

How it is in the Python version:

Powerwolf - Blood of the Saints | Streams: 1134
    Most Played Songs: 
        1. All We Need is Blood | Streams: 145
        2. Son of a Wolf | Streams: 143
        3. Phantom of the Funeral | Streams: 141
        4. Dead Boys Don't Cry | Streams: 132
        5. We Drink Your Blood | Streams: 123
        6. Sanctified with Dynamite | Streams: 120
        7. Murder at Midnight | Streams: 106
        8. Die, Die, Crucify | Streams: 104
        9. Night of the Werewolves | Streams: 94
        10. Ira Sancti (When the Saints Are Going Wild) | Streams: 22
        11. Agnus Dei (Intro) | Streams: 4

do nesting like this (or something in-between) for albums and for artists too!

fsktom commented 2 years ago

But working in Python with \t is much more easy/enjoyable than in Rust...

fsktom commented 1 year ago

Not the same, but adjacent: output/tabs of print command - make them uniform

fsktom commented 1 year ago

Maybe similar to #13?

fsktom commented 1 year ago

Maybe have a separate print function for displaying a single song and another for displaying songs as part of an album

fsktom commented 1 year ago

Finally adressed this in 286f71fb67fe3d4bf82a0a0530f5a2b89a5eac46

>>> print artist
Artist name?
  >> powerwolf
Powerwolf | 1763 plays
    Blood of the Saints | 563 plays
        Dead Boys Don't Cry | 68 plays
        Phantom of the Funeral | 66 plays
        Sanctified with Dynamite | 65 plays
        All We Need is Blood | 64 plays
        Son of a Wolf | 63 plays
        Murder at Midnight | 63 plays
        We Drink Your Blood | 59 plays
        Die, Die, Crucify | 57 plays
        Night of the Werewolves | 53 plays
        Ira Sancti (When the Saints Are Going Wild) | 3 plays
        Agnus Dei (Intro) | 2 plays
    Preachers of the Night | 519 plays
        Amen & Attack | 65 plays
        In the Name of God - Deus Vult | 64 plays
        Nochnoi Dozor | 54 plays
        Lust for Blood | 52 plays
        Coleus Sanctus | 52 plays
        Secrets of the Sacristy | 51 plays
        Extatum Et Oratum | 47 plays
        Kreuzfeuer | 45 plays
        Sacred & Wild | 45 plays
        Cardinal Sin | 43 plays
        Last of the Living Dead | 1 plays
[...]

also normalized dates, so when your inputted dates are either before the first entry or after the last entry, they are automatically adjusted

>>> print time date
Start date? YYYY-MM-DD or 'start'
   > start
End date? YYYY-MM-DD or 'now'
   > now
You've spent 24 days (5.80%) (582 hours / 34938 minutes) listening to music between 2016-04-07 and 2017-05-31 (418 days à 28 plays/day & 1 hours/day)!

while previously it was

>>> print time date
Start date? YYYY-MM-DD or 'start'
   > start
End date? YYYY-MM-DD or 'now'
   > now
You've spent 24 days (0.15%) (582 hours / 34938 minutes) listening to music between 1980-01-01 and 2023-08-05 (15921 days à 0 plays/day & 0 hours/day)!