Skip to content
Snippets Groups Projects
Commit 75ef1653 authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

Playout Log csv export group items by name

parent 1b4ebf91
No related branches found
No related tags found
No related merge requests found
......@@ -223,7 +223,7 @@ MainLayout.Touch=Touchmodus
Search.Button=Suchen
Search.Placeholder=Suche
Search.Alert.NoMatches.Header=Kachelsuche
Search.Alert.NoMatches.Content=Keine weiteren Treffer zu '{}' gefunden.
Search.Alert.NoMatches.Content=Keine weiteren Treffer zu '{}'. gefunden.
# UI - Dialog - Page - Delete
UI.Dialog.Page.Delete.Header=Seite l\u00F6schen
......
......@@ -60,15 +60,26 @@ object CsvPlayoutLogExport {
.map(i => i.getPathUuid -> i.getTime)
items.foreach(item => {
val min: Long = timeMapping.filter(i => i._1 == item.id).minByOption(_._2).map(_._2).getOrElse(0)
val max: Long = timeMapping.filter(i => i._1 == item.id).maxByOption(_._2).map(_._2).getOrElse(0)
timeMapping.filter(i => i._1 == item.id).minByOption(_._2).map(_._2) match {
case Some(value) => item.firstTime = new Date(value)
case _ =>
}
if (min != 0)
item.firstTime = new Date(min)
if (max != 0)
item.lastTime = new Date(max)
timeMapping.filter(i => i._1 == item.id).maxByOption(_._2).map(_._2) match {
case Some(value) => item.lastTime = new Date(value)
case _ =>
}
})
items
items.groupBy(_.name).map((keyValue: (String, Array[CsvColumn])) => {
new CsvColumn(
null,
keyValue._1,
keyValue._2.map(i => i.count).sum,
keyValue._2.map(i => i.seasonCount).maxOption.getOrElse(0),
keyValue._2.map(i => i.firstTime).filter(_ != null).minOption.orNull,
keyValue._2.map(i => i.firstTime).filter(_ != null).minOption.orNull
)
}).toArray
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment