diff --git a/electron/models/dispatcher.cjs b/electron/models/dispatcher.cjs
index 5750350..bb2a9a0 100644
--- a/electron/models/dispatcher.cjs
+++ b/electron/models/dispatcher.cjs
@@ -21,7 +21,6 @@ exports.getDailyZeroedCounts = (person_id) => {
return txGetAll(queryBuilder(), { person_id });
};
exports.getPeople = () => {
- console.log(photo_info.getTotal());
return arr_reduce(
[photo_info.getTotal(), ...people.getPeople()],
"person_uuid"
diff --git a/electron/models/person.cjs b/electron/models/person.cjs
index eca78d5..629cb88 100644
--- a/electron/models/person.cjs
+++ b/electron/models/person.cjs
@@ -38,26 +38,6 @@ exports.getPersonStat = function(person_id, start_date, end_date, stats) {
return result;
};
-// function composeStats(stats) {
-// return stats.map((stat) => {
-// return `select person_uuid, full_name, '${stat}' as stat, ${stat} as value, sum(count) as count
-// from photo_info_rollup_monthly
-// where year_month >= :start_date
-// and year_month <= :end_date
-// and person_uuid = :person_id
-// group by 1,2,3
-// order by count desc`;
-// }).join("\nunion all\n");
-// }
-// exports.getPersonStatFast = function(person_id, start_date, end_date, stats) {
-// const query = `{with count_only as (
-// ${composeStats(stats)}
-// )
-// select
-// person_uuid,
-// full_name,
-// ${stats.join(",")}
-// `;
exports.getDailyZeroedCountsQuery = function() {
return `
@@ -107,50 +87,6 @@ exports.getDailyZeroedCountsQuery = function() {
}
-function composeScores(scores) {
- return scores.map((score) => {
- return `select person_uuid,
- '${score.name}' as score,
- avg(${score.name}) as value
- from photo_info where person_uuid = :person_id
- and date_created >= :start_date and date_created <= :end_date
- group by person_uuid`;
-}).join("\nunion all\n");
-}
-
-function composeScoresOneQuery(scores) {
- return `select
- person_uuid,
- ${scores.map(score => `avg(${score.name}) as ${score.alias}`).join(",\n")}
- from photo_info where person_uuid = :person_id
- and date_created >= :start_date and date_created <= :end_date
- group by person_uuid`;
-
-}
-exports.getCurationScore = function(person_id, start_date, end_date) {
- const query_old = `select
- person_uuid,
- avg(curation_score) as curation_score
- from photo_info where person_uuid = :person_id
- and date_created >= :start_date and date_created <= :end_date
- group by person_uuid`;
- // const query = composeScores(numeric_scores_as_arr_of_objects)
- const query = composeScoresOneQuery(numeric_scores_as_arr_of_objects);
- console.log(query);
- dict = {};
- res = txGetOne(query, {person_id, start_date, end_date});
- // res.forEach((row) => {
- // dict[row.score] = row.value;
-// return;
- // });
- return res;
-}
-// exports.getNumericPersonStats = function(person_id, start_date, end_date) {
-// const query = `
-// select
-
-// `
-// }
exports.getNumericScoresTime = function(person_id, start_date, end_date) {
query = `
with total as (select sum(count) as tot
@@ -171,40 +107,6 @@ exports.getNumericScoresTime = function(person_id, start_date, end_date) {
return txGetOne(query, {person_id, start_date, end_date});
}
-// const numeric_scores = {
-// "curation_score": "curation_score",
-// "zm_activity_score": "activity_score",
-// "zm_video_score": "video_score",
-// "zm_audio_score": "audio_score",
-// "zm_wallpaper_score": "wallpaper_score",
-// "zm_autoplay_suggestion_score": "autoplay_suggestion_score",
-// "zm_blurriness_score": "blurriness_score",
-// "zm_exposure_score": "exposure_score",
-// "zc_behavioral_score": "behavioral_score",
-// "zc_failure_score": "failure_score",
-// "zc_harmonious_color_score": "harmonious_color_score",
-// "zc_immersiveness_score": "immersiveness_score",
-// "zc_interaction_score": "interaction_score",
-// "zc_interesting_subject_score": "interesting_subject_score",
-// "zc_intrusive_object_presence_score": "intrusive_object_presence_score",
-// "zc_lively_color_score": "lively_color_score",
-// "zc_low_light": "low_light",
-// "zc_noise_score": "noise_score",
-// "zc_pleasant_camera_tilt_score": "pleasant_camera_tilt_score",
-// "zc_pleasant_composition_score": "pleasant_composition_score",
-// "zc_pleasant_lighting_score": "pleasant_lighting_score",
-// "zc_pleasant_pattern_score": "pleasant_pattern_score",
-// "zc_pleasant_perspective_score": "pleasant_perspective_score",
-// "zc_pleasant_post_processing_score": "pleasant_post_processing_score",
-// "zc_pleasant_reflection_score": "pleasant_reflection_score",
-// "zc_pleasant_symmetry_score": "pleasant_symmetry_score",
-// "zc_sharply_focused_subject_score": "sharply_focused_subject_score",
-// "zc_tastefully_blurred_score": "tastefully_blurred_score",
-// "zc_well_chosen_subject_score": "well_chosen_subject_score",
-// "zc_well_framed_subject_score": "well_framed_subject_score",
-// "zc_well_timed_shot_score": "well_timed_shot_score"
-// };
-
const numeric_scores_as_arr_of_objects = [
{name: "curation_score", alias: "curation_score"},
{name: "zm_activity_score", alias: "activity_score"},
diff --git a/src/App.svelte b/src/App.svelte
index 33472a7..f8c0c6e 100644
--- a/src/App.svelte
+++ b/src/App.svelte
@@ -135,7 +135,7 @@
{#if activeTab === "Tab1"}
-
- -
- -+
{#each Object.keys(person_numeric_scores) as score}