-
Notifications
You must be signed in to change notification settings - Fork 6
Add date field to albums #18
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
Conversation
DamienCassou
left a comment
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.
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 |
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.
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.
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.
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) |
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.
ALBUM-DATA seems to contain song data instead. If I'm correct, should we rename the variable to song-data?
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.
yes, will do!
| (lambda (album-name) | ||
| (libmpdel--album-create :name album-name | ||
| :artist libmpdel--unknown-artist)) | ||
| (libmpdel-sorted-entries data 'Album)))))) |
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.
before we merge this PR, it would be good to have a PR ready to be merged that introduce sorting back into the UI.
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.
based on my tests, the output of list album is already alphabetically sorted, but that is not documented - is that good enough?
test/libmpdel-test.el
Outdated
| (let ((song (libmpdel--create-song-from-data | ||
| '((Title . "The song") | ||
| (file . "foo/song.ogg") | ||
| (Date . "1970-01-01") |
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.
can we pick another date than Unix epoch?
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.
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) |
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 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.
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.
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)
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 understand, thank you
ce0c4f2 to
c7f7ce4
Compare
|
Can you please rebase this PR? |
DamienCassou
left a comment
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 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 |
DamienCassou
left a comment
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.
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) |
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 understand, thank you

No description provided.