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

Rewrite khinsider #6

Merged
merged 39 commits into from
Jan 13, 2022
Merged

Rewrite khinsider #6

merged 39 commits into from
Jan 13, 2022

Conversation

marcus-crane
Copy link
Owner

@marcus-crane marcus-crane commented Dec 26, 2021

A full rewrite with a changelog coming sometime soon

Closes: #5
Closes: #1

@marcus-crane marcus-crane changed the title Version 2 Rewrite khinsider Dec 26, 2021
@marcus-crane
Copy link
Owner Author

Releasing v2 as it has an autoupdater so can incrementally do the rest.

Copy link
Contributor

@terinjokes terinjokes left a 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.

pkg/indexer/index.go Outdated Show resolved Hide resolved
cmd/khinsider/update.go Outdated Show resolved Hide resolved
cmd/khinsider/update.go Show resolved Hide resolved
internal/updater/updater.go Outdated Show resolved Hide resolved
pkg/download/downloader.go Outdated Show resolved Hide resolved
_ = 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does khinsider care?

Copy link
Owner Author

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" {
Copy link
Contributor

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" {
Copy link
Contributor

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.

Copy link
Owner Author

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.

pkg/update/update.go Outdated Show resolved Hide resolved
pkg/scrape/scrape.go Show resolved Hide resolved
@marcus-crane marcus-crane merged commit a5a18ce into main Jan 13, 2022
@marcus-crane marcus-crane deleted the v2 branch January 13, 2022 10:55
@marcus-crane marcus-crane mentioned this pull request Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add search functionality Improve the help menu
2 participants