pebxcvi commited on
Commit
8b8847a
·
1 Parent(s): 5f3f088

mini update

Browse files
OBJECTS-MAPPED/scripts/log_files.py CHANGED
@@ -11,7 +11,7 @@ def log_zip_files(root_folder, output_file):
11
  if __name__ == "__main__":
12
  # Set the directory you want to start searching from; here it's the current directory
13
  root_folder = "."
14
- output_file = "zip_files.txt"
15
  log_zip_files(root_folder, output_file)
16
  print(f"ZIP file names logged in '{output_file}'.")
17
  import os
@@ -28,6 +28,6 @@ def log_zip_files(root_folder, output_file):
28
  if __name__ == "__main__":
29
  # Set the directory you want to start searching from; here it's the current directory
30
  root_folder = "."
31
- output_file = "zip_files.txt"
32
  log_zip_files(root_folder, output_file)
33
  print(f"ZIP file names without extension logged in '{output_file}'.")
 
11
  if __name__ == "__main__":
12
  # Set the directory you want to start searching from; here it's the current directory
13
  root_folder = "."
14
+ output_file = "files.txt"
15
  log_zip_files(root_folder, output_file)
16
  print(f"ZIP file names logged in '{output_file}'.")
17
  import os
 
28
  if __name__ == "__main__":
29
  # Set the directory you want to start searching from; here it's the current directory
30
  root_folder = "."
31
+ output_file = "files.txt"
32
  log_zip_files(root_folder, output_file)
33
  print(f"ZIP file names without extension logged in '{output_file}'.")
ODC/info/odcinfo.db ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3d011503fc422cf5db0c95b8161f15eda1de908550ff43bf09e7effd595f48e
3
+ size 104693760
ODC/scripts/createdb.py ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sqlite3, os
2
+
3
+ live_file = "ODCInfoLIVE.txt"
4
+ live2_file = "ODCInfoLIVE2.txt"
5
+ db_file = "odcinfo.db"
6
+
7
+ # Keep only the 4 fields you want
8
+ COLUMNS = ["file_name", "lang", "name", "description"]
9
+
10
+ # Indices of these columns in the original TXT line (pipe-delimited)
11
+ ALL_COLUMNS = [
12
+ "file_name","hdk_version","version","uuid","timestamp","lang","default",
13
+ "territory","entitlement_ids","category_ids","product_ids",
14
+ "maker","maker_image","small_image","large_image",
15
+ "scene_entitlement","header","world_map","clans","reward","heat",
16
+ "name","description"
17
+ ]
18
+ COL_IDX = [
19
+ ALL_COLUMNS.index("file_name"),
20
+ ALL_COLUMNS.index("lang"),
21
+ ALL_COLUMNS.index("name"),
22
+ ALL_COLUMNS.index("description"),
23
+ ]
24
+
25
+ def clean_filename(raw_name: str) -> str:
26
+ """Remove live/live$/live2$ prefix and .odc extension, keep only UUID_TXXX."""
27
+ base = os.path.basename(raw_name)
28
+ if base.lower().endswith(".odc"):
29
+ base = base[:-4]
30
+ lower = base.lower()
31
+ if lower.startswith("live2$"):
32
+ base = base[6:] # strip "live2$"
33
+ elif lower.startswith("live$"):
34
+ base = base[5:] # strip "live$"
35
+ elif lower.startswith("live"):
36
+ base = base[4:] # strip "live"
37
+ return base
38
+
39
+ def clean_description(desc: str) -> str:
40
+ """Remove [#Legal] tags from description."""
41
+ return desc.replace("[#Legal]", "").strip()
42
+
43
+ def create_table(conn, table_name):
44
+ cur = conn.cursor()
45
+ col_defs = ", ".join(f'"{c}" TEXT' for c in COLUMNS)
46
+ cur.execute(f"DROP TABLE IF EXISTS {table_name}")
47
+ cur.execute(f"CREATE TABLE {table_name} ({col_defs})")
48
+ conn.commit()
49
+
50
+ def insert_file(conn, table_name, filepath, batch_size=5000):
51
+ cur = conn.cursor()
52
+ placeholders = ",".join("?"*len(COLUMNS))
53
+ sql = f"INSERT INTO {table_name} VALUES ({placeholders})"
54
+ with open(filepath, encoding="utf-8", errors="ignore") as f:
55
+ next(f) # skip header line
56
+ batch=[]
57
+ skipped=0
58
+ for i, line in enumerate(f, 1):
59
+ parts = line.rstrip("\n").split("|")
60
+ selected = [parts[idx] if idx < len(parts) else "" for idx in COL_IDX]
61
+
62
+ # Clean file_name
63
+ if selected[0]:
64
+ selected[0] = clean_filename(selected[0])
65
+
66
+ # Clean description (strip [#Legal])
67
+ if selected[3]:
68
+ selected[3] = clean_description(selected[3])
69
+
70
+ # Skip rows if both name and description are empty/whitespace
71
+ if not selected[2].strip() and not selected[3].strip():
72
+ skipped += 1
73
+ continue
74
+
75
+ batch.append(selected)
76
+ if len(batch) >= batch_size:
77
+ cur.executemany(sql, batch)
78
+ batch.clear()
79
+ if batch:
80
+ cur.executemany(sql, batch)
81
+ conn.commit()
82
+ print(f"Inserted {i:,} rows into {table_name} (skipped {skipped:,} empty rows)")
83
+
84
+ def remove_live_duplicates(conn):
85
+ """Remove rows from live if same file_name exists in live2."""
86
+ cur = conn.cursor()
87
+ cur.execute("""
88
+ DELETE FROM live
89
+ WHERE file_name IN (SELECT file_name FROM live2)
90
+ """)
91
+ deleted = cur.rowcount
92
+ conn.commit()
93
+ print(f"Removed {deleted:,} duplicate rows from live (kept live2)")
94
+
95
+ def main():
96
+ if os.path.exists(db_file):
97
+ os.remove(db_file)
98
+ conn = sqlite3.connect(db_file)
99
+
100
+ # Performance tweaks
101
+ conn.execute("PRAGMA journal_mode=OFF")
102
+ conn.execute("PRAGMA synchronous=OFF")
103
+ conn.execute("PRAGMA temp_store=MEMORY")
104
+ conn.execute("PRAGMA page_size=16384")
105
+
106
+ create_table(conn, "live2")
107
+ create_table(conn, "live")
108
+
109
+ # Insert into live2 first (priority)
110
+ insert_file(conn, "live2", live2_file)
111
+ insert_file(conn, "live", live_file)
112
+
113
+ # Remove duplicates from live
114
+ remove_live_duplicates(conn)
115
+
116
+ conn.execute("VACUUM")
117
+ conn.close()
118
+ print("Done:", db_file)
119
+
120
+ if __name__ == "__main__":
121
+ main()
SCENES-MAPPED/Mapped_Scenes_Query.xlsm CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:74f809b9c5866969525d10bfc081bf647bdaba1f16c36692eb0d5995f406fe99
3
- size 94014716
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c3e90ca512ac8bf0e17aa8b43a61aab6ab262bfc2dfc676aceb30a57f083a32
3
+ size 93822080
SCENES-MAPPED/Mapped_Scenes_Query.xlsx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:85452f305a36dd83e90b9193edcde916ef5e46ac1d485fc805a90866667edd25
3
- size 93289364
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:30bd84ed0336e69f664052428f2707259b1481201e65b924121f48cad09ec88e
3
+ size 93097173