aboutsummaryrefslogtreecommitdiffstats
path: root/nijitrack.py
diff options
context:
space:
mode:
authorPinapelz <donaldshan1@outlook.com>2023-06-23 15:24:55 -0700
committerPinapelz <donaldshan1@outlook.com>2023-06-23 15:24:55 -0700
commit0705853d872e0b45a2f3484e68cd82e2679e523b (patch)
tree9173827c0d2a8f000e475c200955099ffaef9b5e /nijitrack.py
parent31e5416b2f4856894dab669f4a2bd062b587bf55 (diff)
fix: remove inactive hldex channels from ranking graph
Diffstat (limited to 'nijitrack.py')
-rw-r--r--nijitrack.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/nijitrack.py b/nijitrack.py
index 20cc4c8..159c19f 100644
--- a/nijitrack.py
+++ b/nijitrack.py
@@ -82,7 +82,7 @@ def holodex_generation(server: SQLHandler):
for organization in holodex_organizations:
holodex.set_organization(organization)
record_subscriber_data(holodex.get_subscriber_data())
- return holodex.get_generated_channel_data()
+ return holodex.get_generated_channel_data(), holodex.get_inactive_channels()
@log("Running YouTube Generation")
def youtube_generation(server: SQLHandler):
@@ -93,11 +93,18 @@ def youtube_generation(server: SQLHandler):
record_subscriber_data(data)
return data
+def get_excluded_channel_ids(inactive_channel_data: list, excluded_channels: list):
+ channel_ids = []
+ for inactive_channel in inactive_channel_data:
+ if inactive_channel in excluded_channels:
+ continue
+ channel_ids.append(inactive_channel)
+ return channel_ids
+
if __name__ == "__main__":
server = SQLHandler(CONFIG["SQL"]["host"], CONFIG["SQL"]["user"], CONFIG["SQL"]["password"], CONFIG["SQL"]["database"])
initialize_database(server)
- channel_data = holodex_generation(server) # channel_data = youtube_generation(server)
+ channel_data, inactive_channels = holodex_generation(server) # channel_data = youtube_generation(server)
generate_individual_pages(server, channel_data)
- builder.build_ranking_page(server, CONFIG)
-
+ builder.build_ranking_page(server, CONFIG, get_excluded_channel_ids(inactive_channels, fs.get_excluded_channels()))
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage