[Android] Patch: Read tracknumber metadata to sort album's tracklist

Geoffrey Métais geoffrey.metais at gmail.com
Fri Dec 5 17:30:50 CET 2014


Oh right, I missed that.

In this case I'm OK with your patch, I test and push it.

On Fri, Dec 5, 2014 at 5:26 PM, Enno G. <mrmaffen at googlemail.com> wrote:

> Then I would have to duplicate getLocations(int position) in
> AudioBrowserFragment.java and AudioAlbumsSongFragment, because I can't sort
> the ArrayList<String> that getLocations(int position) returns, but only an
> ArrayList<Media> from getMedia(int position). Another option would be a
> static utils-method. Both of these options are uglier than the current way
> of doing it imo. That's why I decided to do it with a boolean switch as the
> second parameter.
> Let me know what you think.
>
> Greets
> Enno
>
> 2014-12-05 16:13 GMT+01:00 Geoffrey Métais <geoffrey.metais at gmail.com>:
>
>> This sorting will only by used while loading an album or appending it in
>> current playlist.
>>
>> I would prefer you to not sort in getLocations, but call Collections.sort
>> in handleContextItemSelected and in OnItemClickListener for album in
>> AudioBrowserFragment.
>>
>> This should prevent adding too much code in AudioBrowserListAdapter and
>> computing useless checks/sorts.
>>
>> Otherwise it's all good.
>>
>> On Fri, Dec 5, 2014 at 2:50 AM, Enno G. <mrmaffen at googlemail.com> wrote:
>>
>>> Hey,
>>>
>>> setting a default number for the field mTrackNumber in Media.java
>>> wouldn't change anything. Setting an empty String in TrackInfo.java is
>>> wrong in my opinion.
>>> So I just added an "if (empty || null)"-check, so that the
>>> NumberFormatException is only thrown if the String is non-null, non-empty
>>> and not parsable.
>>>
>>> Greets
>>> Enno
>>>
>>> _______________________________________________
>>> Android mailing list
>>> Android at videolan.org
>>> https://mailman.videolan.org/listinfo/android
>>>
>>>
>>
>> _______________________________________________
>> Android mailing list
>> Android at videolan.org
>> https://mailman.videolan.org/listinfo/android
>>
>>
>
> _______________________________________________
> Android mailing list
> Android at videolan.org
> https://mailman.videolan.org/listinfo/android
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/android/attachments/20141205/8aa46dd2/attachment-0001.html>


More information about the Android mailing list