Skip to content

Conversation

@pinoaffe
Copy link
Contributor

@pinoaffe pinoaffe commented Jun 2, 2025

No description provided.

Copy link
Contributor

@DamienCassou DamienCassou left a comment

Choose a reason for hiding this comment

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

Thank you for your work. I think some parts of the PR are not completely related. If you don't agree, can you please tell me why they are? We should add some unit tests in this case if possible.

libmpdel.el Outdated
(cl-defmethod libmpdel-list ((_entity (eql albums)) function)
"Call FUNCTION with all albums as parameter."
(libmpdel-send-command
;; TODO: maybe compute all albums by listing all songs
Copy link
Contributor

Choose a reason for hiding this comment

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

What about creating an ISSUE instead of adding this TODO? This way we can have a conversation about it, make a decision and keep a trace of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do!

libmpdel.el Outdated
"Return a list of songs from DATA, a server's response."
(mapcar #'libmpdel--create-song-from-data (libmpdel-group-data data)))

(defun libmpdel--create-album-from-data (album-data)
Copy link
Contributor

Choose a reason for hiding this comment

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

ALBUM-DATA seems to contain song data instead. If I'm correct, should we rename the variable to song-data?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, will do!

(lambda (album-name)
(libmpdel--album-create :name album-name
:artist libmpdel--unknown-artist))
(libmpdel-sorted-entries data 'Album))))))
Copy link
Contributor

Choose a reason for hiding this comment

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

before we merge this PR, it would be good to have a PR ready to be merged that introduce sorting back into the UI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

based on my tests, the output of list album is already alphabetically sorted, but that is not documented - is that good enough?

(let ((song (libmpdel--create-song-from-data
'((Title . "The song")
(file . "foo/song.ogg")
(Date . "1970-01-01")
Copy link
Contributor

Choose a reason for hiding this comment

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

can we pick another date than Unix epoch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

:album (libmpdel--album-create
:name (cdr (assq 'Album song-data))
:artist (libmpdel--artist-create :name (cdr (assq 'Artist song-data))))
:album (libmpdel--create-album-from-data song-data)
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems unrelated to "Add date field to albums". Can we keep that for another PR? I will better understand the goal this way and we can merge this one sooner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is technically unrelated to the field itself, but imo intimately related to the code: adding date fields to albums (and populating those fields with dates) means that the exact same album-creation-code would have to be duplicated in three separate places, to prevent that I factored said code into a function

(especially since in the next PR I'll add even more code to libmpdel--create-album-from-data, which would otherwise also have to be copied identically to three different places)

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand, thank you

@pinoaffe pinoaffe force-pushed the add-date branch 2 times, most recently from ce0c4f2 to c7f7ce4 Compare June 2, 2025 22:07
@DamienCassou
Copy link
Contributor

When ready, please click the double-arrow next to my name:
image

This will add the review to my todo list. Feel free to do the same for all PRs you open when ready to get a review.

@DamienCassou
Copy link
Contributor

Can you please rebase this PR?

Copy link
Contributor

@DamienCassou DamienCassou left a comment

Choose a reason for hiding this comment

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

Some of my comments didn't get answered. It's ok not to agree but it would be nice to answer so I better understand your intent.

@pinoaffe
Copy link
Contributor Author

Some of my comments didn't get answered. It's ok not to agree but it would be nice to answer so I better understand your intent.

Oh sorry, I tried to answer several questions at once, for the sake of clarity I will answer each question on its own

Copy link
Contributor

@DamienCassou DamienCassou left a comment

Choose a reason for hiding this comment

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

Great job, thank you!

:album (libmpdel--album-create
:name (cdr (assq 'Album song-data))
:artist (libmpdel--artist-create :name (cdr (assq 'Artist song-data))))
:album (libmpdel--create-album-from-data song-data)
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand, thank you

@DamienCassou DamienCassou merged commit 3bc15d7 into mpdel:master Jun 15, 2025
1 check passed
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.

2 participants