Adding Music directories is broken

Bug #1273333 reported by jus
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
High
Max Linke

Bug Description

1.12.0-alpha-pre (build master r4016) OSX

You can add music directories in the preferences, but the content does not show up in the library. This happens also if you add a initial directory on first start. Library scanner seems to work, but no track is listed in the library table, even after restart.

Drag and drop import to the library table works fine.

Tags: library
RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: none → 1.12.0
importance: Undecided → High
Revision history for this message
Max Linke (max-linke) wrote : Re: [Bug 1273333] [NEW] Adding Music directories is broken

This does not appear on linux. I'll check it tomorrow on windows

On Mon, 2014-01-27 at 17:22 +0000, jus wrote:
> Public bug reported:
>
> 1.12.0-alpha-pre (build master r4016) OSX
>
> You can add music directories in the preferences, but the content does
> not show up in the library. This happens also if you add a initial
> directory on first start. Library scanner seems to work, but no track is
> listed in the library table, even after restart.
>
> Drag and drop import to the library table works fine.
>
> ** Affects: mixxx
> Importance: Undecided
> Status: New
>
>
> ** Tags: library
>

Revision history for this message
jus (jus) wrote :

Hmm, i tried again, and came to different results.
Might be just an misunderstanding how the library scanner actually works.

On 1st startup:
* Mixxx prompts to select a music directory
* When selected, it starts scanning the tracks
* If you let Mixxx finish the initial scan, it is all good. The tracks show up in the library as expected
* But if you press the `Cancel` button during the initial scan, none of the tracks that has been scanned up to this point, show up in the library. Even on restart, none of the tracks is there. They show only up, if you hit `Rescan library`and let the scan run tough.

We allow to cancel the initial scan, but pressing said button should not bear the risk of getting lost on the first. Is it possible to show at least the tracks that have been scanned already?

When adding a n-th music directory in the preferences:
* The tracks from the directory only show up when invoking the `Rescan library` command

I`d expect that adding a music directory would add tracks being in it automatically to the library.

Revision history for this message
Max Linke (max-linke) wrote : Re: [Bug 1273333] Re: Adding Music directories is broken

On Wed, 2014-01-29 at 12:37 +0000, jus wrote:
> Hmm, i tried again, and came to different results.
> Might be just an misunderstanding how the library scanner actually works.
No you definitely hit a bug

> On 1st startup:
> * Mixxx prompts to select a music directory
> * When selected, it starts scanning the tracks
> * If you let Mixxx finish the initial scan, it is all good. The tracks show up in the library as expected
> * But if you press the `Cancel` button during the initial scan, none of the tracks that has been scanned up to this point, show up in the library. Even on restart, none of the tracks is there. They show only up, if you hit `Rescan library`and let the scan run tough.
Yeah I can confirm this

> We allow to cancel the initial scan, but pressing said button should not
> bear the risk of getting lost on the first. Is it possible to show at
> least the tracks that have been scanned already?
yeah that was the default behavior. Maybe rryans libraryscanner
improvements broke this.

>
> When adding a n-th music directory in the preferences:
> * The tracks from the directory only show up when invoking the `Rescan library` command
>
> I`d expect that adding a music directory would add tracks being in it
> automatically to the library.
Yeah that would be nice. But finding the new tracks means that we have
to initiate a library rescan. When should that be ideally?

I don't want to automatically start it as soon as the filedialog closes
in case the user hit ok on a wrong directory. We could use a QDialog and
ask if the library should be scanned again if the number of directories
has changed once the preference dialog is closed.

Revision history for this message
jus (jus) wrote : Re: [Bug 1273333] Adding Music directories is broken

>> When adding a n-th music directory in the preferences:
>> * The tracks from the directory only show up when invoking the `Rescan library` command
>>
>> I`d expect that adding a music directory would add tracks being in it
>> automatically to the library.
> Yeah that would be nice. But finding the new tracks means that we have
> to initiate a library rescan. When should that be ideally?
>
> I don't want to automatically start it as soon as the filedialog closes
> in case the user hit ok on a wrong directory. We could use a QDialog and
> ask if the library should be scanned again if the number of directories
> has changed once the preference dialog is closed.

I don't think we need to be over protective here. If a user adds a `wrong` directory, he can always remove it later.

Bad luck if he adds massive folders during performance, and the library scanner chokes the audio output.
But how likely is such scenario?

Alternatively , what about a workflow that mimics removing a music directory?
Clicking `Add` brings up a new dialog that briefly explains the manual rescan and the auto rescan option + three buttons
1. Cancel 2. Add files later 3. Add files instantly (Default)

If we do this, how would you deal with music directories added from the Browse mode. Currently there is no UI feedback at all.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

I think making a popup that asks if you want to rescan after adding a dir
(from preferences or browse) makes sense.
On Jan 30, 2014 11:05 AM, "jus" <email address hidden> wrote:

> >> When adding a n-th music directory in the preferences:
> >> * The tracks from the directory only show up when invoking the `Rescan
> library` command
> >>
> >> I`d expect that adding a music directory would add tracks being in it
> >> automatically to the library.
> > Yeah that would be nice. But finding the new tracks means that we have
> > to initiate a library rescan. When should that be ideally?
> >
> > I don't want to automatically start it as soon as the filedialog closes
> > in case the user hit ok on a wrong directory. We could use a QDialog and
> > ask if the library should be scanned again if the number of directories
> > has changed once the preference dialog is closed.
>
> I don't think we need to be over protective here. If a user adds a
> `wrong` directory, he can always remove it later.
>
> Bad luck if he adds massive folders during performance, and the library
> scanner chokes the audio output.
> But how likely is such scenario?
>
> Alternatively , what about a workflow that mimics removing a music
> directory?
> Clicking `Add` brings up a new dialog that briefly explains the manual
> rescan and the auto rescan option + three buttons
> 1. Cancel 2. Add files later 3. Add files instantly (Default)
>
> If we do this, how would you deal with music directories added from the
> Browse mode. Currently there is no UI feedback at all.
>
> --
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
> https://bugs.launchpad.net/bugs/1273333
>
> Title:
> Adding Music directories is broken
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mixxx/+bug/1273333/+subscriptions
>

Revision history for this message
Max Linke (max-linke) wrote :

I'm concerned what happens if we accidentally start 2 scanning
processes. Currently this is not possible. A solution might be to
restart the scanner if a new request for a scan comes in.

On Thu, 2014-01-30 at 16:27 +0000, RJ Ryan wrote:
> I think making a popup that asks if you want to rescan after adding a dir
> (from preferences or browse) makes sense.
> On Jan 30, 2014 11:05 AM, "jus" <email address hidden> wrote:
>
> > >> When adding a n-th music directory in the preferences:
> > >> * The tracks from the directory only show up when invoking the `Rescan
> > library` command
> > >>
> > >> I`d expect that adding a music directory would add tracks being in it
> > >> automatically to the library.
> > > Yeah that would be nice. But finding the new tracks means that we have
> > > to initiate a library rescan. When should that be ideally?
> > >
> > > I don't want to automatically start it as soon as the filedialog closes
> > > in case the user hit ok on a wrong directory. We could use a QDialog and
> > > ask if the library should be scanned again if the number of directories
> > > has changed once the preference dialog is closed.
> >
> > I don't think we need to be over protective here. If a user adds a
> > `wrong` directory, he can always remove it later.
> >
> > Bad luck if he adds massive folders during performance, and the library
> > scanner chokes the audio output.
> > But how likely is such scenario?
> >
> > Alternatively , what about a workflow that mimics removing a music
> > directory?
> > Clicking `Add` brings up a new dialog that briefly explains the manual
> > rescan and the auto rescan option + three buttons
> > 1. Cancel 2. Add files later 3. Add files instantly (Default)
> >
> > If we do this, how would you deal with music directories added from the
> > Browse mode. Currently there is no UI feedback at all.
> >
> > --
> > You received this bug notification because you are a member of Mixxx
> > Development Team, which is subscribed to Mixxx.
> > https://bugs.launchpad.net/bugs/1273333
> >
> > Title:
> > Adding Music directories is broken
> >
> > To manage notifications about this bug go to:
> > https://bugs.launchpad.net/mixxx/+bug/1273333/+subscriptions
> >
>

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Yea, there's no check against that currently but it would be easy to add.

On Thu, Jan 30, 2014 at 4:16 PM, Max Linke <email address hidden>wrote:

> I'm concerned what happens if we accidentally start 2 scanning
> processes. Currently this is not possible. A solution might be to
> restart the scanner if a new request for a scan comes in.
>
> On Thu, 2014-01-30 at 16:27 +0000, RJ Ryan wrote:
> > I think making a popup that asks if you want to rescan after adding a dir
> > (from preferences or browse) makes sense.
> > On Jan 30, 2014 11:05 AM, "jus" <email address hidden> wrote:
> >
> > > >> When adding a n-th music directory in the preferences:
> > > >> * The tracks from the directory only show up when invoking the
> `Rescan
> > > library` command
> > > >>
> > > >> I`d expect that adding a music directory would add tracks being in
> it
> > > >> automatically to the library.
> > > > Yeah that would be nice. But finding the new tracks means that we
> have
> > > > to initiate a library rescan. When should that be ideally?
> > > >
> > > > I don't want to automatically start it as soon as the filedialog
> closes
> > > > in case the user hit ok on a wrong directory. We could use a QDialog
> and
> > > > ask if the library should be scanned again if the number of
> directories
> > > > has changed once the preference dialog is closed.
> > >
> > > I don't think we need to be over protective here. If a user adds a
> > > `wrong` directory, he can always remove it later.
> > >
> > > Bad luck if he adds massive folders during performance, and the library
> > > scanner chokes the audio output.
> > > But how likely is such scenario?
> > >
> > > Alternatively , what about a workflow that mimics removing a music
> > > directory?
> > > Clicking `Add` brings up a new dialog that briefly explains the manual
> > > rescan and the auto rescan option + three buttons
> > > 1. Cancel 2. Add files later 3. Add files instantly (Default)
> > >
> > > If we do this, how would you deal with music directories added from the
> > > Browse mode. Currently there is no UI feedback at all.
> > >
> > > --
> > > You received this bug notification because you are a member of Mixxx
> > > Development Team, which is subscribed to Mixxx.
> > > https://bugs.launchpad.net/bugs/1273333
> > >
> > > Title:
> > > Adding Music directories is broken
> > >
> > > To manage notifications about this bug go to:
> > > https://bugs.launchpad.net/mixxx/+bug/1273333/+subscriptions
> > >
> >
>
> --
> You received this bug notification because you are a member of Mixxx
> Development Team, which is subscribed to Mixxx.
> https://bugs.launchpad.net/bugs/1273333
>
> Title:
> Adding Music directories is broken
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mixxx/+bug/1273333/+subscriptions
>

Revision history for this message
Max Linke (max-linke) wrote :

https://github.com/mixxxdj/mixxx/pull/170

this fixes the issue with canceling. The other stuff needs more work

Revision history for this message
Max Linke (max-linke) wrote : Re: [Bug 1273333] Re: Adding Music directories is broken

I just realized that the automatic restart of the library scanner has to
wait a bit. The problem is that the libraryscanner blocks all other
transaction so it is actually not possible to add a new directory to the
database while we scan the library.

A nice solution for me would be to write a sentence about the rescanning
in the library options and have a QWarningBox pop-up if a directory is
added via the browse dialog.

On Thu, 2014-01-30 at 22:26 +0000, Max Linke wrote:
> https://github.com/mixxxdj/mixxx/pull/170
>
> this fixes the issue with canceling. The other stuff needs more work
>

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Did you try this? SQLite only allows one transaction per connection. The scanner uses a separate connection (and the scanner transaction only affects the library table too).

Adding a directory while scanning should be possible since the scanner doesn't write to the directory table (so the transactions affect different tables). Relocating is possibly a different story since track locations and library are affected by that.

Also, the scanner is a singleton (MixxxApp creates just one) but it's possible to start it twice. We should fix that so that trying to start it while it's already running fails.

Revision history for this message
Max Linke (max-linke) wrote :

Yeah I tried it. Does it work on Mac?

Revision history for this message
Max Linke (max-linke) wrote :

Besides that a user has to rescan the library and the normal issues with the blocking libraryScanner this is fixed for me. I can't reproduce any of the described errors with the current master.

Should be show a pop-up that a manual rescan of the library is required if directories are added?

Max Linke (max-linke)
Changed in mixxx:
status: New → In Progress
assignee: nobody → Max Linke (max-linke)
Revision history for this message
Max Linke (max-linke) wrote :

Jus is the current solution in trunk ok for you?

Revision history for this message
jus (jus) wrote :

Sry for late reply.

Your current solutions works ok, thanks.
Plz see my comment in https://github.com/mixxxdj/mixxx/commit/9ee88ce6ef8a4054a367b653b6ac8d22f3f6b728

Changed in mixxx:
status: In Progress → Fix Committed
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/7281

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.