summary refs log tree commit diff stats
path: root/ganarchy.py
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2019-04-19 22:32:15 -0300
committerSoniEx2 <endermoneymod@gmail.com>2019-04-19 22:32:15 -0300
commit105164e6619c92db20886af7539bb19a5bc915c5 (patch)
tree30ab313920acd52cb60af514d9b2fb3ef09d0f48 /ganarchy.py
parent429d3d5b304fa0907c8a7838d7e6212233b881c2 (diff)
Sort(?) correctly(?)
Diffstat (limited to 'ganarchy.py')
-rwxr-xr-xganarchy.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ganarchy.py b/ganarchy.py
index dffceca..a9c3486 100755
--- a/ganarchy.py
+++ b/ganarchy.py
@@ -198,7 +198,12 @@ def cron_target():
     (project_commit, project_title) = c.fetchone()
     entries = []
     generate_html = []
-    for (url,) in c.execute("""SELECT url FROM repos WHERE active == 1"""):
+    for (e, url,) in c.execute("""SELECT max(e), url FROM (SELECT max(T1.entry) e, T1.url FROM repo_history T1
+                                                        WHERE (SELECT active FROM repos T2 WHERE url = T1.url)
+                                                        GROUP BY T1.url
+                                                        UNION
+                                                        SELECT null, T3.url FROM repos T3 WHERE active)
+                               GROUP BY url ORDER BY e"""):
         result = handle_target(url, project_commit)
         if result is not None:
             count, post_hash, msg = result