Download videos from oldest to newest
This commit is contained in:
		@@ -43,7 +43,7 @@ func DownloadAllVideos(db *sql.DB) error {
 | 
				
			|||||||
	log.Printf("Starting downloads...")
 | 
						log.Printf("Starting downloads...")
 | 
				
			||||||
	for {
 | 
						for {
 | 
				
			||||||
		// Fetch the next record from the database
 | 
							// Fetch the next record from the database
 | 
				
			||||||
		row := db.QueryRow("select id, url, `cast`, title, description, upload_date, thumbnail from videos where state = 'pending' limit 1")
 | 
							row := db.QueryRow("select id, url, `cast`, title, description, upload_date, thumbnail from videos where state = 'pending' order by id desc limit 1")
 | 
				
			||||||
		var id int
 | 
							var id int
 | 
				
			||||||
		var href, cast, title, description, uploadDateStr, thumbnailUrl string
 | 
							var href, cast, title, description, uploadDateStr, thumbnailUrl string
 | 
				
			||||||
		err = row.Scan(&id, &href, &cast, &title, &description, &uploadDateStr, &thumbnailUrl)
 | 
							err = row.Scan(&id, &href, &cast, &title, &description, &uploadDateStr, &thumbnailUrl)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user