Jason Moiron avatar Jason Moiron committed a0a2a6e

attempt to get rid of a wrong css select issue, only update if -u is passed naked without download, show latest 20 log lines correctly (not first 20)

Comments (0)

Files changed (3)

 
 func (c *Config) GetLog(numlines int) []*Log {
 	messages := make([]*Log, 0)
-	rows, err := c.db.Query("SELECT timestamp, message FROM log ORDER BY timestamp ASC LIMIT ?", numlines)
+	rows, err := c.db.Query("SELECT timestamp, message FROM (SELECT * FROM log ORDER BY timestamp DESC LIMIT ?) T1 ORDER BY timestamp", numlines)
 	if err != nil {
 		fmt.Printf("Error occured fetching log: %s\n", err)
 		return messages
 		vPrintf("Verbosity on.\n")
 	}
 
-	if opts.Download {
-		DownloadNewChapters()
-		return
-	}
-
 	if len(opts.SetDownloadPath) > 0 {
 		config.SetVal("DownloadPath", opts.SetDownloadPath)
 		return
 
 	if opts.Update {
 		Update()
+		if !opts.Download {
+			return
+		}
+	}
+
+	if opts.Download {
+		DownloadNewChapters()
+		return
 	}
 
 	if opts.Search {
 }
 
 func (m *MangaAccess) GetImageUrl(doc *Document) string {
-	img := doc.CssSelect("div#pic img")
+	img := doc.CssSelect("#pic img")
 	if len(img) == 0 {
 		return ""
 	}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.