webinos/app-webinosTV — pull request #33 by lamuertepeluda (2013-03-26 16:56:36+00:00)
Title: APPWTV-52 duplicate item in source device playlist

APPWTV-52: not only it is now possible to add/remove duplicate entries from device queue, **preserving consistency** (i.e. removing from the main store removes all the copies from all device queues), but I also added a new function (queryByString) to the Store prototype (and its subclasses) to query items in a querystring-like fashion.
A new store/GenericMediaStore subclass (DeviceQueueMediaStore) has been added to handle duplicate items in the source device queue.
This function is available also in the media items manager:
```javascript
var mim=webinosTV.app.connectUi.getMediaItemsManager();
//get all items with with title=="Top Song" and file=="my file"
mim.queryMediaItems("title=Top Song&file=my file");

//remove all items with title="Top Song"
mim.removeMediaItems("title=Top Song");

```
Just one **CAVEAT**: after this update all device and media ids **must** be of type string and media items id **MUST NOT CONTAIN** a dash/minus character ('-'). No validation is currently performed on this field right now, so be careful and exclude this character from any media item id. This is because the dash is used to handle duplicate media items IDs by DeviceQueueMediaStore. The default policy of sencha seems not to allow duplicate records with the same key/id (and seems wise to me, btw), but this class circumvents now this policy trying to preserve data consistency with the main media item store.