slash2009 / XWMM

XBMC Web Media Manager
Other
56 stars 20 forks source link

Serveral times watched movie are not displayed as watched #103

Closed Qedinux closed 9 years ago

Qedinux commented 10 years ago

In the database, if files.playCount greater than 1, the movie appears as unwatched on the XWMM web interface.

If I set it as unwatched, the value in the database comes back to null => This is OK If I set it as watched, the value in the database goes to 1 => This is OK If I see the movie a 2nd time, the value in the database goes to 2 => This is OK but on the web interface the movie is diplayed as unwatched.

I'm currently using :

The jsonrpc request returns the good value for playcount property. So the bug is in the XWMM web interface.

un1versal commented 10 years ago

Im sure that a xwmm console log would be somewhat helpful addition. See https://github.com/slash2009/XWMM/wiki/F.A.Q.-Frequently-asked-questions

Qedinux commented 10 years ago

bug xwmm

As I understand, the playcount value comming from XBMC database is mapped with 'watched' attribute. This is declared in 'movielist.js' at lines 24 to 30: var MovieRecord = Ext.data.Record.create([ { name: 'movieid' }, { name: 'Movietitle', mapping: 'title' }, { name: 'watched', mapping: 'playcount' }, { name: 'set' }, { name: 'year' } ]);

This is a small extract of the json rpc responce giving me the movie list: {"label":"Avril Lavigne - The best damn tour - Live in Toronto","movieid":3,"playcount":2,"set":"","title":"Avril Lavigne - The best damn tour - Live in Toronto","year":2008}, {"label":"Babel","movieid":4,"playcount":0,"set":"","title":"Babel","year":2006}, {"label":"Back to the future - 1","movieid":5,"playcount":1,"set":"Back to the future","title":"Back to the future - 1","year":1985},

The playcount values (mapped to watched) comming from XBMC are 0 if the movie has never been seen and 1 or more if the movie has already been seen one or more times.

The problem comes with the renderer function checkWatched declared in 'include.js' at line 229: var movieColumnModel = new Ext.grid.ColumnModel([ { header: 'Title', dataIndex: 'Movietitle', id: 'title' }, { header: '<img src="../resources/images/icons/set.png" width="16" height="16" alt="In Set">', dataIndex: 'set', width: 30, renderer: checkSet, tooltip: 'In Set' }, { header: '<img src="../resources/images/icons/checked.png" width="16" height="16" alt="Watched">', dataIndex: 'watched', width: 26, renderer: checkWatched, tooltip: 'Watched' } ]);

The function 'checkWatched' is declared at line 214 in 'include.js' function checkWatched(value) { return value === 1 ? '<img src="../resources/images/icons/checked.png" width="16" height="16" alt="Watched">' : ''; }

The bug appears if value is greater than 1. Although the movie has been seen several times, it appears as unwatched. This is not correct.

un1versal commented 10 years ago

I always thought the condition was

0 unwatched 1 watched

there's no 2 3 4 etc for the watched flag at least (times watched is not the same iirc). The amount of times you watched the same file shouldn't alter the fact it is still watched. Im going to see what Kodi does now when I rewatch a file.

ghost commented 9 years ago

Fixed in PR #114