Comment 2 for bug 1358275

Revision history for this message
Andrew Hayzen (ahayzen) wrote : Re: [Bug 1358275] Re: SongsModel.status is not set as MediaStatus.Ready if rowCount is zero

The case we have is not when filtering the model to be empty, but when
mediascanner has no music in its index (eg nothing in ~/Music) it then
wasn't changing the status. Sorry we should have been more clear in the bug.

I'll be able to double check this with your example later, but you may be
able to confirm it before I get back.

On 20 August 2014 09:03, James Henstridge <email address hidden>
wrote:

> Can you provide some code that demonstrates the bug?
>
> I put together this simple program to try and reproduce the problem, but
> came up blank. When I run it, I get the following output:
>
> qml: Status changed to 1, count = 0
> qml: Status changed to 0, count = 5784
>
> So the status property's notify signal is correctly firing for the
> Loading and Ready state changes. When I press enter, which updates the
> model to filter for artist "no such artist", I get some more output:
>
> qml: Status changed to 1, count = 0
> qml: Status changed to 0, count = 0
>
> Since both the row count and status properties have notify signals, the
> bottom text component in the UI also updates to say "empty" at this
> point.
>
> ** Attachment added: "model-status-change.qml"
>
> https://bugs.launchpad.net/mediascanner2/+bug/1358275/+attachment/4182284/+files/model-status-change.qml
>
> ** Changed in: mediascanner2
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to Ubuntu
> Music App.
> https://bugs.launchpad.net/bugs/1358275
>
> Title:
> SongsModel.status is not set as MediaStatus.Ready if rowCount is zero
>
> Status in Media Scanner v2:
> Incomplete
> Status in Music application for Ubuntu devices:
> New
>
> Bug description:
> Currently the Music app is attempting to integrate Content Hub support
> with the help of the streaming models provided by Mediascanner [1].
> One of the changes we making is to properly detect when the models are
> loading vs there being no music on the device. Right now we are
> catching the onFilled signal to set the model to a 'populated' state.
> However, this also means that when new media is found (either by the
> user copying songs over, or because a song is imported via content
> hub) the rowCount is reset and we briefly detect that there is no
> music.
>
> We are trying to make this check detect the empty state 1)
> allSongsModel.rowCount === 0 and 2) SongsModel.status ===
> ModelStatus.Ready. However SongsModel.status never seems to be in the
> Ready state when rowCount is zero.
>
> [1] https://code.launchpad.net/~andrew-hayzen/music-app/content-hub-
> dest-support/+merge/231037
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mediascanner2/+bug/1358275/+subscriptions
>