optimize adding album and multiple files to mediaplaylist
ClosedPublic

Authored by astippich on Jul 1 2018, 11:29 AM.

Details

Summary

use the existing methods to batch adding an album and files.
adjust tests and fix exposed errors

Test Plan

test pass, adding of album and files in elisa still works

Diff Detail

Repository
R255 Elisa
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
astippich requested review of this revision.Jul 1 2018, 11:29 AM
astippich created this revision.
mgallien requested changes to this revision.Aug 31 2018, 8:58 PM

Thanks for taking care of that. Please have a look at my comments.

src/mediaplaylist.cpp
590

Instead of that, please extend MusicAlbum to allow access to the list of tracks and just enqueue a list of MusicAudioTrack. That would be the fastest solution.

621–629

Instead of modifying it, it is possible to only keep one instead of having enqueue(QList<String>) and enqueue(QList<QUrl>) ?

791–801

Why do you want to change that ? It seems at least unrelated to your patch.

This revision now requires changes to proceed.Aug 31 2018, 8:58 PM
astippich updated this revision to Diff 40810.Sep 1 2018, 9:55 AM
  • directly query track list from music album
astippich marked an inline comment as done.Sep 1 2018, 9:58 AM
astippich added inline comments.
src/mediaplaylist.cpp
621–629

You mean providing only one method for file urls, and getting rid of adding stringlists? that is certainly possible, but requires more changes throughout the code. for example, elisaapplication currently only gives a stringlist to the mediaplaylist.
I would prefer to do that separately.

791–801

This is needed to pass the tests and makes it more similar to the method adding a single file url.
The method was implemented by me for the file browser, and was not unit tested until now.

mgallien added inline comments.Oct 12 2018, 7:36 PM
src/mediaplaylist.cpp
621–629

I agree.

791–792

Can you use auto here ?

src/musicalbum.cpp
224

Please use a const reference ? That should avoid allocating a list that will later be only read.

astippich updated this revision to Diff 43510.Oct 12 2018, 8:35 PM
  • make const ref and use auto
  • fix test
mgallien accepted this revision.Oct 15 2018, 7:52 PM

Thanks for your work

This revision is now accepted and ready to land.Oct 15 2018, 7:52 PM
This revision was automatically updated to reflect the committed changes.