Skip to content

Use GetID3 package from Composer#346

Merged
lGuillaume124 merged 5 commits into
Sonerezh:masterfrom
MightyCreak:upgrade-getid3
Sep 6, 2018
Merged

Use GetID3 package from Composer#346
lGuillaume124 merged 5 commits into
Sonerezh:masterfrom
MightyCreak:upgrade-getid3

Conversation

@MightyCreak

@MightyCreak MightyCreak commented Sep 1, 2018

Copy link
Copy Markdown
Contributor

The goal of this PR is to use GetID3 package from Composer instead of the old package included right now, and fix #343.

Here's what I've done:

This might not be the right way of doing things between CakePHP and Composer, I don't know much about those. Feel free to tell me how it should be done if there's a better way.

  • By using Composer's GetID3 package, the old GetID3 package is no longer needed so I removed the app/Vendor directory (it's the vast majority of this PR content).

  • Once that done, in order to have only one Vendor directory for all the Composer packages (i.e. CakePHP and GetID3), I changed Composer installation directory from Vendor to app/Vendor.

  • Then I added james-heinrich/getid3 in composer.json (and remove ext-gd since it doesn't seem to be a valid Composer package).

  • Then I included the app/Vendor/autoload.php in bootstrap.php to be able to easily instantiate classes from the Vendor directory.

  • And finally I changed CAKE_CORE_INCLUDE_PATH to point to app/Vendor and I removed the App::import from SongManager.php.

@lGuillaume124

Copy link
Copy Markdown
Contributor

When we tried to update this lib from 1.9.7-20130705 to the very next version we noticed it was a little bit longer to fetch the cover arts. That's why we didn't upgrade it but it seems to be required now…

@MightyCreak

Copy link
Copy Markdown
Contributor Author

I haven't seen a big difference (but I haven't profiled either). I'll check that.

For sure the package is heavier (I guess it handles more format as well), but I don't think it's really a problem if a package is taking 200 kB instead of 100 kB (numbers are fake). If you don't have enough space for that on your server, I guess you'll have other problems 😁

About the cover, a simple optimization could be to check for the cover image first in the album dir? It would be faster for sure, I know it would for me since I always keep a cover.jpg in the album directory, but I guess not everyone does that 😉

@MightyCreak

Copy link
Copy Markdown
Contributor Author

Ok so I tested the import of my library (2597 files) with the old and the new GetID3 lib, using the command line (because it's easier to benchmark like that):

  • Old: 25s
  • New: 1min58s

That's clearly much longer (x4), but from my perspective, it's not that bad since it only affects the import. It would surely have been nicer if it has been faster, but I think using a package that is easy to upgrade is more valuable that the added delay during the import. Maybe GetID3 v2 that is in preview at the moment tries to address that?

PS: By using the command line, I saw that there was a problem with the new CakePHP path there, so I fixed it: 6e7572d.

@MightyCreak

MightyCreak commented Sep 2, 2018

Copy link
Copy Markdown
Contributor Author

I updated the CHANGELOG as well -- the "Unreleased" section is a good practice I got from https://keepachangelog.com/, so that you don't have to browse all the commits when it's time to do a release.

@MightyCreak

Copy link
Copy Markdown
Contributor Author

@lGuillaume124 I know you're in the new database refactor, but since this PR also fixes #343, would you consider merging it?

@gs11 would you like to review it as well?

@lGuillaume124

Copy link
Copy Markdown
Contributor

As the « WIP » label was still here I thought you were still working on it.

@lGuillaume124 lGuillaume124 added this to the 1.2.4 milestone Sep 5, 2018
@lGuillaume124 lGuillaume124 self-requested a review September 5, 2018 16:49
@gs11

gs11 commented Sep 5, 2018

Copy link
Copy Markdown

LGTM, great work! @MightyCreak

@MightyCreak MightyCreak changed the title WIP: Use GetID3 package from Composer Use GetID3 package from Composer Sep 5, 2018
@MightyCreak

MightyCreak commented Sep 5, 2018

Copy link
Copy Markdown
Contributor Author

Thanks guys!
I was expecting to have done something bad so I didn't remove the "WIP" flag 😅

@lGuillaume124 lGuillaume124 merged commit 818c68f into Sonerezh:master Sep 6, 2018
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.

Error on CLI import

3 participants