diff options
author | Sunil Shetye | 2025-02-07 12:26:04 +0530 |
---|---|---|
committer | Sunil Shetye | 2025-02-07 12:26:04 +0530 |
commit | 9bffbd4fcd56d59eae5de66006b12cf41a1eb015 (patch) | |
tree | b5c3ffeea263f2f450d4e4cfa150597c2c7944e0 | |
parent | 29fd7c2dc29c674b8949dbc95b96c595f737ec45 (diff) | |
download | Common-Interface-Project-9bffbd4fcd56d59eae5de66006b12cf41a1eb015.tar.gz Common-Interface-Project-9bffbd4fcd56d59eae5de66006b12cf41a1eb015.tar.bz2 Common-Interface-Project-9bffbd4fcd56d59eae5de66006b12cf41a1eb015.zip |
update media
-rw-r--r-- | blocks/eda-frontend/src/static/gallery/gallery100.png | bin | 33203 -> 33512 bytes | |||
-rw-r--r-- | blocks/eda-frontend/src/static/gallery/gallery101.png | bin | 39979 -> 39118 bytes | |||
-rw-r--r-- | blocks/eda-frontend/src/static/gallery/gallery102.png | bin | 45069 -> 44125 bytes | |||
-rw-r--r-- | blocks/eda-frontend/src/static/gallery/gallery103.png | bin | 25794 -> 25541 bytes | |||
-rw-r--r-- | blocks/eda-frontend/src/static/gallery/gallery104.png | bin | 26016 -> 39142 bytes | |||
-rw-r--r-- | blocks/eda-frontend/src/static/gallery/gallery105.png | bin | 35467 -> 38816 bytes | |||
-rw-r--r-- | blocks/eda-frontend/src/static/gallery/gallery106.png | bin | 35740 -> 38885 bytes | |||
-rw-r--r-- | blocks/eda-frontend/src/static/gallery/gallery107.png | bin | 29808 -> 33546 bytes | |||
-rw-r--r-- | blocks/eda-frontend/src/static/gallery/gallery108.png | bin | 37362 -> 36933 bytes | |||
-rw-r--r-- | blocks/eda-frontend/src/static/gallery/gallery109.png | bin | 34202 -> 33932 bytes | |||
-rw-r--r-- | blocks/update_media.py | 100 |
11 files changed, 0 insertions, 100 deletions
diff --git a/blocks/eda-frontend/src/static/gallery/gallery100.png b/blocks/eda-frontend/src/static/gallery/gallery100.png Binary files differindex bcf1eb9d..adbc6fd4 100644 --- a/blocks/eda-frontend/src/static/gallery/gallery100.png +++ b/blocks/eda-frontend/src/static/gallery/gallery100.png diff --git a/blocks/eda-frontend/src/static/gallery/gallery101.png b/blocks/eda-frontend/src/static/gallery/gallery101.png Binary files differindex bafa6ab6..92439642 100644 --- a/blocks/eda-frontend/src/static/gallery/gallery101.png +++ b/blocks/eda-frontend/src/static/gallery/gallery101.png diff --git a/blocks/eda-frontend/src/static/gallery/gallery102.png b/blocks/eda-frontend/src/static/gallery/gallery102.png Binary files differindex 7907a45f..a8e02250 100644 --- a/blocks/eda-frontend/src/static/gallery/gallery102.png +++ b/blocks/eda-frontend/src/static/gallery/gallery102.png diff --git a/blocks/eda-frontend/src/static/gallery/gallery103.png b/blocks/eda-frontend/src/static/gallery/gallery103.png Binary files differindex d655cf1d..e2681dad 100644 --- a/blocks/eda-frontend/src/static/gallery/gallery103.png +++ b/blocks/eda-frontend/src/static/gallery/gallery103.png diff --git a/blocks/eda-frontend/src/static/gallery/gallery104.png b/blocks/eda-frontend/src/static/gallery/gallery104.png Binary files differindex afd2eb9e..dd9b36e6 100644 --- a/blocks/eda-frontend/src/static/gallery/gallery104.png +++ b/blocks/eda-frontend/src/static/gallery/gallery104.png diff --git a/blocks/eda-frontend/src/static/gallery/gallery105.png b/blocks/eda-frontend/src/static/gallery/gallery105.png Binary files differindex 1e93993e..f000a73a 100644 --- a/blocks/eda-frontend/src/static/gallery/gallery105.png +++ b/blocks/eda-frontend/src/static/gallery/gallery105.png diff --git a/blocks/eda-frontend/src/static/gallery/gallery106.png b/blocks/eda-frontend/src/static/gallery/gallery106.png Binary files differindex 7452fe25..6aaf12c9 100644 --- a/blocks/eda-frontend/src/static/gallery/gallery106.png +++ b/blocks/eda-frontend/src/static/gallery/gallery106.png diff --git a/blocks/eda-frontend/src/static/gallery/gallery107.png b/blocks/eda-frontend/src/static/gallery/gallery107.png Binary files differindex 2e42397e..134ec613 100644 --- a/blocks/eda-frontend/src/static/gallery/gallery107.png +++ b/blocks/eda-frontend/src/static/gallery/gallery107.png diff --git a/blocks/eda-frontend/src/static/gallery/gallery108.png b/blocks/eda-frontend/src/static/gallery/gallery108.png Binary files differindex ec6a14e1..c3973b43 100644 --- a/blocks/eda-frontend/src/static/gallery/gallery108.png +++ b/blocks/eda-frontend/src/static/gallery/gallery108.png diff --git a/blocks/eda-frontend/src/static/gallery/gallery109.png b/blocks/eda-frontend/src/static/gallery/gallery109.png Binary files differindex b926e7c2..87ec190c 100644 --- a/blocks/eda-frontend/src/static/gallery/gallery109.png +++ b/blocks/eda-frontend/src/static/gallery/gallery109.png diff --git a/blocks/update_media.py b/blocks/update_media.py index 90894628..dcfdb5c0 100644 --- a/blocks/update_media.py +++ b/blocks/update_media.py @@ -5,97 +5,6 @@ import shutil import sqlite3 -# def empty_table(db_path, table_name): -# """ -# Empties all rows in the specified table. -# """ -# try: -# # Connect to the database -# conn = sqlite3.connect(db_path) -# cursor = conn.cursor() - -# # Validate table name to avoid SQL injection -# if not table_name.isidentifier(): -# raise ValueError(f"Invalid table name: {table_name}") - -# # SQL to delete all rows from the table -# sql = f"DELETE FROM {table_name};" - -# # Execute the query -# cursor.execute(sql) - -# # Commit the changes -# conn.commit() -# print(f"Table '{table_name}' has been emptied successfully.") - -# except sqlite3.Error as e: -# print(f"Database error while emptying the table: {e}") - -# except ValueError as ve: -# print(ve) - -# finally: -# # Close the database connection -# if conn: -# conn.close() - - -# def populate_table(db_path, table_name, json_path): -# """ -# Populates the specified table with data from a JSON file. -# """ -# conn = None -# try: -# # Load data from JSON file -# with open(json_path, 'r') as json_file: -# data = json.load(json_file) - -# # Connect to the database -# conn = sqlite3.connect(db_path) -# cursor = conn.cursor() - -# # Validate table name to avoid SQL injection -# if not table_name.isidentifier(): -# raise ValueError(f"Invalid table name: {table_name}") - -# # Insert data into the table -# for record in data: -# if not isinstance(record, dict): -# print(f"Skipping invalid record: {record}") -# continue - -# # Add save_time if not present -# if 'save_time' not in record: -# record['save_time'] = datetime.now().strftime("%Y-%m-%d %H:%M:%S") - -# columns = ", ".join(record.keys()) -# placeholders = ", ".join("?" for _ in record.values()) -# sql = f"INSERT INTO {table_name} ({columns}) VALUES ({placeholders})" - -# try: -# cursor.execute(sql, tuple(record.values())) -# except sqlite3.Error as e: -# print(f"Failed to insert record {record}: {e}") - -# # Commit the changes -# conn.commit() -# print(f"Table '{table_name}' has been populated successfully.") - -# except sqlite3.Error as e: -# print(f"Database error while populating the table: {e}") - -# except FileNotFoundError: -# print(f"JSON file '{json_path}' not found.") - -# except ValueError as ve: -# print(ve) - -# finally: -# # Close the database connection -# if conn: -# conn.close() - - def update_media_column(db_path, table_name): """ Updates the media column in the table to store '<save_id>.png' based on the save_id value. @@ -178,15 +87,6 @@ if __name__ == "__main__": table_name = "saveAPI_gallery" statesave_table = "saveAPI_statesave" - # Path to the JSON file containing the data - # json_file_path = "eda-frontend/src/utils/GallerySchSample.json" - - # Empty the table first - # empty_table(database_path, table_name) - - # # Populate the table with JSON data - # populate_table(database_path, table_name, json_file_path) - update_media_column(database_path, table_name) join_and_copy_images(database_path, statesave_table, table_name) |