mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-25 05:47:57 +02:00
Fixed storing last import timestamp
This commit is contained in:
parent
fa7732c538
commit
1af484e0f6
3 changed files with 34 additions and 16 deletions
|
@ -102,6 +102,9 @@ var listensCmd = &cobra.Command{
|
|||
result.ImportCount, result.TotalCount, targetName)
|
||||
|
||||
// Update timestamp
|
||||
if result.LastTimestamp.Unix() < timestamp.Unix() {
|
||||
result.LastTimestamp = timestamp
|
||||
}
|
||||
fmt.Printf("Latest timestamp: %v (%v)\n", result.LastTimestamp, result.LastTimestamp.Unix())
|
||||
err = db.SetImportTimestamp(sourceName, targetName, "listens", result.LastTimestamp)
|
||||
cobra.CheckErr(err)
|
||||
|
|
|
@ -102,6 +102,9 @@ var lovesCmd = &cobra.Command{
|
|||
result.ImportCount, result.TotalCount, targetName)
|
||||
|
||||
// Update timestamp
|
||||
if result.LastTimestamp.Unix() < timestamp.Unix() {
|
||||
result.LastTimestamp = timestamp
|
||||
}
|
||||
fmt.Printf("Latest timestamp: %v (%v)\n", result.LastTimestamp, result.LastTimestamp.Unix())
|
||||
err = db.SetImportTimestamp(sourceName, targetName, "loves", result.LastTimestamp)
|
||||
cobra.CheckErr(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue