implement lukas/openmediacenter#72
This commit is contained in:
parent
ebb55eb0dc
commit
6b4267b50b
@ -44,9 +44,11 @@ func getVideoHandlers() {
|
||||
likes = iota
|
||||
random = iota
|
||||
names = iota
|
||||
length = iota
|
||||
)
|
||||
|
||||
var SortClause string
|
||||
// if wrong number passed no sorting is performed
|
||||
var SortClause = ""
|
||||
switch args.Sort {
|
||||
case date:
|
||||
SortClause = "ORDER BY create_date DESC, movie_name"
|
||||
@ -60,6 +62,9 @@ func getVideoHandlers() {
|
||||
case names:
|
||||
SortClause = "ORDER BY movie_name"
|
||||
break
|
||||
case length:
|
||||
SortClause = "ORDER BY length DESC"
|
||||
break
|
||||
}
|
||||
|
||||
var query string
|
||||
|
@ -19,7 +19,8 @@ export enum SortBy {
|
||||
date,
|
||||
likes,
|
||||
random,
|
||||
name
|
||||
name,
|
||||
length
|
||||
}
|
||||
|
||||
interface Props extends RouteComponentProps {}
|
||||
@ -189,6 +190,7 @@ export class HomePage extends React.Component<Props, state> {
|
||||
<span onClick={(): void => this.onDropDownItemClick(SortBy.likes, 'Most likes')}>Most likes</span>
|
||||
<span onClick={(): void => this.onDropDownItemClick(SortBy.random, 'Random')}>Random</span>
|
||||
<span onClick={(): void => this.onDropDownItemClick(SortBy.name, 'Name')}>Name</span>
|
||||
<span onClick={(): void => this.onDropDownItemClick(SortBy.length, 'Length')}>Length</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user