Bug 232093 - Capacity gauge is not updated after copying files to iPod & MTP
Summary: Capacity gauge is not updated after copying files to iPod & MTP
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Media Devices (show other bugs)
Version: 2.4.3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 236485 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-25 11:17 UTC by Hakan Bayindir
Modified: 2011-12-04 22:24 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.5
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hakan Bayindir 2010-03-25 11:17:03 UTC
Version:           2.3.0 (using 4.3.4 (KDE 4.3.4), Debian packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.32-3-686-bigmem

When I upload songs to my iPod nano 2nd gen, the capacity gauge displayed under the song count doesn't get updated despite the increase in song count.

How to reproduce:
1- Plug in your iPod
2- Mount it, amarok will automount it.
3- Copy enough files which will make a difference in capacity of the device (I filled half of my empty iPod in that case)
4- Wait for file copy end.
5- Observe the increased song count but unchanged capacity gauge.
6- Congrats! You just reproduced a bug!

What should happen:
1- Plug in your iPod
2- Mount it, amarok will automount it.
3- Copy enough files which will make a difference in capacity of the device (I filled half of my empty iPod in that case)
4- Wait for file copy end.
5- Observe the increased song and capacity gauge shows correct "% filled" on its display (If 75% percent of my device space is available, I should see the display at 25% (percent used))

I'm using a standard amarok without any fancy things installed.
Comment 1 Sven Krohlas 2010-03-25 11:45:28 UTC
Isn't that the same as bug 231827?
Comment 2 Hakan Bayindir 2010-03-25 18:07:05 UTC
Unfortunately no. bug 231827 is about deletion of songs from iPod. This happens when uploading.

When deleting: Neither count, nor capacity gauge changes
When adding  : Count changes but capacity gauge not.

Cheers.
Comment 3 Sven Krohlas 2010-05-08 20:54:15 UTC
*** Bug 236485 has been marked as a duplicate of this bug. ***
Comment 4 Hakan Bayindir 2010-05-26 18:39:25 UTC
This ticket is also valid for Amarok 2.3.0.90 (2.3.1 Beta 1).
Comment 5 Myriam Schweingruber 2011-06-04 12:08:33 UTC
This is an automated message from the triager:

Amarok 2.4.1 has been released on May 8 already. Could you please upgrade and test if you can still reproduce this bug?

Without feedback within a month we will close this bug as resolved.

Thank you for your understanding.
Comment 6 Myriam Schweingruber 2011-07-15 09:07:00 UTC
Closing for lack of feedback. Feel free to reopen if you can still reproduce this with Amarok 2.4.2 beta 1 or later and provide the necessary feedback.
Comment 7 Dainius Masiliūnas 2011-08-09 11:45:32 UTC
Confirmed, this still happens on Amarok 2.4.3, with slight differences: it does update the first track that is uploaded, but not any of the subsequent ones, and neither the count nor the size gauge changes then, although the tracks are shown under the device properly.

This happens on openSUSE 11.4, tested using iRiver T10a MTP device.
Comment 8 Myriam Schweingruber 2011-08-09 21:28:42 UTC
Thank you for the feedback.
Comment 9 Dainius Masiliūnas 2011-11-06 08:30:51 UTC
Note that this is *not* specific to the iPod - as I noted, I am using an iRiver MTP device here.
Comment 10 Bart Cerneels 2011-11-06 09:08:17 UTC
iPod & MTP only as it's fixed for USB Mass Storage.
Comment 11 Matěj Laitl 2011-12-04 19:47:59 UTC
I'm working on the iPod part of this.
Comment 12 Matěj Laitl 2011-12-04 22:24:29 UTC
Git commit 94a92530f2ab7f8acef6715659c78b14bc263428 by Matěj Laitl.
Committed on 04/12/2011 at 23:00.
Pushed by laitl into branch 'master'.

MediaDeviceCollection: do not cache used capacity w/out update mechanism

Relevant media device handler should do this caching, and even without
it, the calls aren't that expensive. Solves first part of bug 232093,
second part (that deals with track count) will follow shortly.

CCBUG: 232093

M  +2    -16   src/core-impl/collections/mediadevicecollection/MediaDeviceCollection.cpp
M  +0    -5    src/core-impl/collections/mediadevicecollection/MediaDeviceCollection.h
M  +0    -2    src/core-impl/collections/mediadevicecollection/handler/MediaDeviceHandler.cpp

http://commits.kde.org/amarok/94a92530f2ab7f8acef6715659c78b14bc263428
Comment 13 Matěj Laitl 2011-12-04 22:24:29 UTC
Git commit 43d000e2dd20795c514d8124a615ecfeb7377e49 by Matěj Laitl.
Committed on 04/12/2011 at 23:17.
Pushed by laitl into branch 'master'.

Fix completely bogus MediaDeviceHandler::removeMediaDeviceTrackFromColl

That method did not work _at all_ because it used wrong key in the
trackMap forgot to actually write back other maps. :-)

As a result, dead tracks were never removed from memory collection and
thus the count was not updated, among other (worse) things.

BUG: 232093
FIXED-IN: 2.5
DIGEST: Capacity gauge is now always updated for iPods & MTP devices

M  +2    -0    ChangeLog
M  +11   -8    src/core-impl/collections/mediadevicecollection/handler/MediaDeviceHandler.cpp

http://commits.kde.org/amarok/43d000e2dd20795c514d8124a615ecfeb7377e49