mirror of
https://github.com/koel/koel.git
synced 2026-04-25 08:46:00 +03:00
[GH-ISSUE #39] Importing artists with a & in their name #30
Labels
No labels
Authentication
Dependencies
Documentation
Feature Request
Flac
Help Wanted
Installation/Setup
Integration
Mobile
PR Welcome
Pending Release
Performance
Playlist
S3
Search
Sync
[Pri] Low
[Pri] Normal
[Status] Keep Open
[Status] Needs Author Reply
[Status] Needs Review
[Status] Stale
[Status] Will Implement
[Type] Blessed
[Type] Bug
[Type] Duplicate
[Type] Enhancement
[Type] Help Request
[Type] Question
[Type] Task
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/koel-koel#30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @whachoe on GitHub (Dec 14, 2015).
Original GitHub issue: https://github.com/koel/koel/issues/39
Hi,
When trying to import an album of an artist with '&' in their name (ex: Djihan & Kamien), i get a unique constraint-error from the Artist-model.
I can fix it by changing the following method:
to this:
I'm not sure if i should send a PR for this, since you kind of mentioned the html_entity_decode is necessary in some cases. And seems it's only in some rare cases. Might have something to do with a weirdly formatted id3-tag. I'll try to find the file that caused the mayhem and update my report afterwards..
@juliusvdijk commented on GitHub (Dec 15, 2015):
Isn't there a better way to solve this?
In the comment he states that the name stored in the ID3 tags might be html entity encoded so I imagine that this fix breaks more things than it fixes.
@phanan commented on GitHub (Dec 15, 2015):
I'll be thinking about this. A quick fix could be just replace
&with&, but that's not optimal.@reeslo commented on GitHub (Dec 16, 2015):
just to say, for me the error as occurred for the first scan. If you want more info I can investigate for tell you the filename/tags
@phanan commented on GitHub (Dec 17, 2015):
@whachoe @Reeslo What are you guys' table encodings?
@whachoe commented on GitHub (Dec 17, 2015):
CHARSET=utf8 COLLATE=utf8_unicode_ci
Engine: InnoDB
mysql --version: mysql Ver 14.14 Distrib 5.5.46, for debian-linux-gnu (x86_64) using readline 6.3
@reeslo commented on GitHub (Dec 17, 2015):
utf8_unicode_ci
InnoDB too
mysql Ver 15.1 Distrib 5.5.46-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
the default schema collation is utf8mb4_general_ci / characterset utf8mb4

but I think this has no effect :
@phanan commented on GitHub (Dec 18, 2015):
I pushed an attempt to fix this. Let me know it it works.
On Fri, Dec 18, 2015 at 2:26 AM, Reeslo notifications@github.com wrote:
@reeslo commented on GitHub (Dec 18, 2015):
Ok, I check that today
@whachoe commented on GitHub (Dec 18, 2015):
Just tested here... That seems to do the trick. Started with an empty DB and it's filling up nicely.
@phanan commented on GitHub (Dec 19, 2015):
Great! I'm closing this issue then.
@reeslo commented on GitHub (Dec 19, 2015):
Import work for me until the end (without clean up database before).
But some error appear
github.com/phanan/koel@a2484362c2/app/Models/Album.php (L71)Debug log :
@phanan commented on GitHub (Dec 19, 2015):
What's the value of
$cover['image_mime']?On Sat, Dec 19, 2015 at 2:59 PM, Reeslo notifications@github.com wrote:
@reeslo commented on GitHub (Dec 19, 2015):
'image_mime' => '',
'picturetype' => 'Other',
'description' => '',
'datalength' => 24534,
@reeslo commented on GitHub (Dec 19, 2015):
[2015-12-19 08:18:47] local.ERROR: array (
'data' => '' . "\0" . '' . "\0" . '' . "\0" . '',
'image_mime' => '',
'picturetype' => 'Other',
'description' => '',
'datalength' => 3,
)
@reeslo commented on GitHub (Dec 19, 2015):
the first contain a big binary data. tell me how can I get the filepath if you want to know what type of file is it.
@phanan commented on GitHub (Dec 19, 2015):
Try changing this line into:
Basically we're assuming it to be a PNG file here.
@reeslo commented on GitHub (Dec 19, 2015):
It works !
@phanan commented on GitHub (Dec 19, 2015):
Great. I'll introduce this fix into the codebase. Thanks for reporting!
On Sat, Dec 19, 2015 at 5:08 PM, Reeslo notifications@github.com wrote:
@reeslo commented on GitHub (Dec 19, 2015):
For the first file (wo has empty $extension[1])
For this file seems not an png :

@reeslo commented on GitHub (Dec 19, 2015):
I have located the album folder for this corrupted file.
You can see in the complete dump of $info = $this->getID3->analyze($file->getPathname()); (App\Services\Media > getInfo) :
https://framadrop.org/r/PNP2ZY1GNV#Pk+ioG3FTDn2TU8G0sgqGkWgXfhLvKQHxnQD9Vxu+KE=
You can see the file mime is image/jpeg
Screenshot of folder content :
