2023-08-28 23:50:41 +02:00
|
|
|
import {SortingByTypes, SortingMethod} from './entities/SortingMethods';
|
2020-09-06 17:07:40 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This contains the action of the supported list of *.pg2conf files.
|
|
|
|
* These files are passed down to the client as metaFiles (like photos and directories)
|
|
|
|
*/
|
|
|
|
export const PG2ConfMap = {
|
|
|
|
sorting: {
|
2023-08-28 23:50:41 +02:00
|
|
|
'.order_descending_name.pg2conf': {method: SortingByTypes.Name, ascending: false} as SortingMethod,
|
|
|
|
'.order_ascending_name.pg2conf': {method: SortingByTypes.Name, ascending: true} as SortingMethod,
|
|
|
|
'.order_descending_date.pg2conf': {method: SortingByTypes.Date, ascending: false} as SortingMethod,
|
|
|
|
'.order_ascending_date.pg2conf': {method: SortingByTypes.Date, ascending: true} as SortingMethod,
|
|
|
|
'.order_descending_rating.pg2conf': {method: SortingByTypes.Rating, ascending: false} as SortingMethod,
|
|
|
|
'.order_ascending_rating.pg2conf': {method: SortingByTypes.Rating, ascending: true} as SortingMethod,
|
|
|
|
'.order_random.pg2conf': {method: SortingByTypes.Rating, ascending: null} as SortingMethod,
|
|
|
|
'.order_descending_person_count.pg2conf': {method: SortingByTypes.PersonCount, ascending: false} as SortingMethod,
|
|
|
|
'.order_ascending_person_count.pg2conf': {method: SortingByTypes.PersonCount, ascending: true} as SortingMethod,
|
2022-04-04 19:37:31 +02:00
|
|
|
},
|
2020-09-06 17:07:40 +02:00
|
|
|
};
|
2021-05-29 23:27:52 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* These files are processed on the server side,
|
|
|
|
* do not get passed down to the client or saved to the DB
|
|
|
|
*/
|
|
|
|
|
|
|
|
export enum ServerSidePG2ConfAction {
|
2021-05-30 18:18:24 +02:00
|
|
|
// Enum always starts from 1 as !!0 === false
|
2022-04-04 19:37:31 +02:00
|
|
|
SAVED_SEARCH = 1,
|
2021-05-29 23:27:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export const ServerPG2ConfMap: { [key: string]: ServerSidePG2ConfAction } = {
|
2022-04-04 19:37:31 +02:00
|
|
|
'.saved_searches.pg2conf': ServerSidePG2ConfAction.SAVED_SEARCH,
|
2021-05-29 23:27:52 +02:00
|
|
|
};
|
|
|
|
|