Files
stash/ui/v2.5/src/utils/percent.ts
CJ 0664c5b974 Track watch activity for scenes. (#3055)
* track watchtime and view time
* add view count sorting, added continue position filter
* display metrics in file info
* add toggle for tracking activity
* save activity every 10 seconds
* reset resume when video is nearly complete
* start from beginning when playing scene in queue

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2022-11-21 12:55:15 +11:00

18 lines
274 B
TypeScript

const numberToString = (seconds: number) => {
return seconds + "%";
};
const stringToNumber = (v?: string) => {
if (!v) {
return 0;
}
const numStr = v.replace("%", "");
return parseInt(numStr, 10);
};
export default {
numberToString,
stringToNumber,
};