OSDN Git Service

Do not display 0
[fukui-no-namari/fukui-no-namari.git] / src / Hage1 / thread_window.py
index 134e222..39ddc85 100644 (file)
@@ -115,6 +115,11 @@ class WinWrap:
                 etag = headers["Etag"]
 
         if self.num > 0:
+            if not self.title:
+                self.title = datfile.get_title_from_dat(
+                    self.bbs, self.board, self.thread)
+                if self.title:
+                    self.window.set_title(self.title)
             # save idx
             idx_dic = {"title": self.title, "lineCount": self.num,
                    "lastModified": lastmod, "etag": etag}
@@ -140,12 +145,6 @@ class WinWrap:
         self.http_get_dat(save_line_and_append_to_buffer)
         dat_file.close()
 
-        if not self.title:
-            self.title = datfile.get_title_from_dat(
-                self.bbs, self.board, self.thread)
-            if self.title:
-                self.window.set_title(self.title)
-
     def load_dat(self):
         self.size = 0
         self.num = 0