-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat: search album by name #13434
base: main
Are you sure you want to change the base?
feat: search album by name #13434
Conversation
296f79e
to
843eb4f
Compare
@@ -302,4 +302,47 @@ export class AlbumRepository implements IAlbumRepository { | |||
|
|||
return result.affected; | |||
} | |||
|
|||
@GenerateSql({ params: [DummyValue.UUID, DummyValue.STRING, undefined] }) | |||
getByName(userId: string, albumName: string, shared?: boolean): Promise<AlbumEntity[]> { |
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 should be paginated, no? Only returning the first 1k results is optimistic 😅
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 would be nice but I don't think that really matters: the goal of this endpoint is not to get all albums.
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.
IMO we should try to have all of our endpoints behave in a similar manner. Search person vs search album vs search something else should all have the same method signatures.
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 strongly agree and there are people out there with >10k albums, for whom a search result may very well include >1k albums. I think it's bad just not supporting that.
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 think it's bad just not supporting that.
I agree. But that's for a future PR 😝
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 agree. But that's for a future PR 😝
Why? :P
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.
Why? :P
Because I agree with @jrasm91 too. Do we want the same method signatures or not ?
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.
Hm that's fair.
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.
Well... I added pagination for both endpoints.
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.
LOL. Thank you very much! :)
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.
LGTM, it'd be awesome if you could add (at least) unit tests though. :)
843eb4f
to
f391adf
Compare
87fa15f
to
1751e5f
Compare
1751e5f
to
5889faa
Compare
@danieldietzler So the API for |
Yup, we probably should. It's great that we don't have mobile conflicts though |
b9c5144
to
c0a39fa
Compare
c0a39fa
to
274de40
Compare
b843db3
to
db1915c
Compare
This new
searchAlbum
endpoint behaves like thesearchPerson
endpoint. It returns a list of albums based on the beginning of the album name you are searching for. Currently, album search based on name is done on the client side, which is not ideal when you have hundreds or thousands of albums.