Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

misc_tracks_misc_artists_folder - array support #147

Open
tomchiverton opened this issue Nov 19, 2021 · 5 comments
Open

misc_tracks_misc_artists_folder - array support #147

tomchiverton opened this issue Nov 19, 2021 · 5 comments

Comments

@tomchiverton
Copy link
Contributor

For "reasons" I have, under a single folder ('/exports/mp3')

Albums - contains a folder per album
Summer - contains files by different artists
Spring - contains files by different artists

The trouble is that this makes single tracks show up in the library as album tracks

$cfg['misc_tracks_misc_artists_folder'] would solve this, but I think it only works for one folder name under $cfg['media_dir']

If it was an array, my library would import much cleaner

@tomchiverton
Copy link
Contributor Author

This terrible, terrible hack in update.php gives me what I want. I can probably put together a merge request that does it right ?

In if ($isUpdateRequired) { just before $row=mysqli_fetch_assoc($result);

$_tc_bn = basename($dir);
if( $_tc_bn == 'Summer_good' || $_tc_bn == 'Spring_start' ){
        $artist = 'Various Artists';
        $artist_alphabetic      = $artist;
        $aGenre = '';
        $year = NULL;
        $album = basename($dir);
}

Screenshot_20211119_154328

@tomchiverton
Copy link
Contributor Author

Another way would be to say "my albums are all in folder X, folder's Y,Z are all singles"

@ArturSierzant
Copy link
Owner

I think your idea to make $cfg['misc_tracks_misc_artists_folder'] an array would be a good solution. It would also be good if update could take covers from those folders - so each of your folder (spring, summer, etc.) could have different covers.

I'll add this feature to TODO list, but if you solve this issue, feel free to create pull request.

@tomchiverton
Copy link
Contributor Author

If I set this

$cfg['misc_tracks_misc_artists_folder'] = 'Summer_good,Spring_start,Winter_bad,Autumn_end';

Based on some debugging, it looks like it picks a random (first ?) file from each folder, and that files metadata is used for the album at that path.

So I can do

843a844,860
> 
>               // misc_tracks_misc_artists_folder might also be a CSV
>               $miscs = explode( ',',$cfg['misc_tracks_misc_artists_folder'] );
>               if( count($miscs) > 1 ){
>                       $is_misc = false;
>                       foreach($miscs as $misc){
>                               if( basename($dir) == $misc ){
>                                       $is_misc = true;
> 
>                                       $artist = 'Various Artists';
>                                               $artist_alphabetic      = $artist;
>                                       $aGenre = '';
>                                       $year = NULL;
>                                       $album = basename($dir);
>                               }
>                   

Then have to do a full "force update of ALL files" and it worked.

A track entry, with an album_id entry for the track.album_id :

album_id path album_add_time updated
gvyx3lr0mp /exports/mp3/Summer_good/ 1635694644 1

and in album it's listed as 'various artists', shows up when I search for "Summer_good" in the web site etc

Is this enough for you to merge in or do you want a fuller MR, or maybe a different approach

@tomchiverton
Copy link
Contributor Author

I'd also be useful for it to set the album created for each $cfg['misc_tracks_misc_artists_folder'] to be last updated by the most recent file, so it'd pop to the front of "new albums" when a file is added ?

I can't see how to do that, but it'd be the same place that sets the picture from (the most recent?) file ?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants