-
Notifications
You must be signed in to change notification settings - Fork 6
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
Rewrite khinsider #6
Conversation
Releasing v2 as it has an autoupdater so can incrementally do the rest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without nitpicking too much, I've left a few comments for things that jump out at me.
_ = doc.Find("#EchoTopic table:not(#songList) tr div a").Each(func(i int, s *goquery.Selection) { | ||
coverUrl, exists := s.Attr("href") | ||
if exists { | ||
// TODO: Use proper escaping. Tried stdlib but it escaped everything |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does khinsider care?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember anymore but I think there were some covers that were served with spaces which caused me trouble somewhere down the line.
songMeta := make(map[int]string) | ||
_ = doc.Find("#songlist_header th").Each(func(i int, s *goquery.Selection) { | ||
header := strings.TrimSpace(s.Text()) | ||
if header == "CD" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (and songMeta[i]
below) might be clearer with a switch.
songMeta[i] = "TrackLength" | ||
songMeta[i+1] = "MP3FileSize" | ||
} | ||
if header == "FLAC" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some albums have WAV
, OGG
, and M4A
that might be worth tracking as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, eventually I'll add those but currently it just defaults to MP3
so even tracking FLAC is a bit pointless. It needs a bit more investigation into how the page layouts look for those other formats.
A full rewrite with a changelog coming sometime soon
Closes: #5
Closes: #1