mirror of
https://github.com/BreizhHardware/Jellystat.git
synced 2026-01-18 16:27:20 +01:00
fix for #417, sets duration to 0 if negative int detected
This commit is contained in:
@@ -1,32 +1,39 @@
|
||||
////////////////////////// pn delete move to playback
|
||||
const columnsPlaybackReporting = [
|
||||
"rowid",
|
||||
"DateCreated",
|
||||
"UserId",
|
||||
"ItemId",
|
||||
"ItemType",
|
||||
"ItemName",
|
||||
"PlaybackMethod",
|
||||
"ClientName",
|
||||
"DeviceName",
|
||||
"PlayDuration",
|
||||
];
|
||||
////////////////////////// pn delete move to playback
|
||||
const columnsPlaybackReporting = [
|
||||
"rowid",
|
||||
"DateCreated",
|
||||
"UserId",
|
||||
"ItemId",
|
||||
"ItemType",
|
||||
"ItemName",
|
||||
"PlaybackMethod",
|
||||
"ClientName",
|
||||
"DeviceName",
|
||||
"PlayDuration",
|
||||
];
|
||||
|
||||
const mappingPlaybackReporting = (item) => {
|
||||
let duration = item[9];
|
||||
|
||||
const mappingPlaybackReporting = (item) => ({
|
||||
rowid:item[0] ,
|
||||
DateCreated:item[1] ,
|
||||
UserId:item[2] ,
|
||||
ItemId:item[3] ,
|
||||
ItemType:item[4] ,
|
||||
ItemName:item[5] ,
|
||||
PlaybackMethod:item[6] ,
|
||||
ClientName:item[7] ,
|
||||
DeviceName:item[8] ,
|
||||
PlayDuration:item[9] ,
|
||||
});
|
||||
if (duration === null || duration === undefined || duration < 0) {
|
||||
duration = 0;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
columnsPlaybackReporting,
|
||||
mappingPlaybackReporting,
|
||||
};
|
||||
return {
|
||||
rowid: item[0],
|
||||
DateCreated: item[1],
|
||||
UserId: item[2],
|
||||
ItemId: item[3],
|
||||
ItemType: item[4],
|
||||
ItemName: item[5],
|
||||
PlaybackMethod: item[6],
|
||||
ClientName: item[7],
|
||||
DeviceName: item[8],
|
||||
PlayDuration: duration,
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
columnsPlaybackReporting,
|
||||
mappingPlaybackReporting,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user