From f90c532a8f7c631422dacf1113fec15d34c21f5e Mon Sep 17 00:00:00 2001 From: Jacob Casper Date: Tue, 3 Apr 2018 23:03:51 -0400 Subject: [PATCH] v0.3.1: commit 76d327d92fd6f6d9aa45bdf47a92cc169bea22ef Author: Jacob Casper Date: Tue Apr 3 23:03:37 2018 -0400 Fixed sqlite bug caught on server --- callback.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/callback.php b/callback.php index 2b92014..be99a1a 100644 --- a/callback.php +++ b/callback.php @@ -7,7 +7,6 @@ const BASE_URL = 'https://api.spotify.com/v1/'; const AUTH_URL = 'https://accounts.spotify.com/'; const DATE_FILE = 'prev_date.txt'; - const DATE_FORM = 'm/d/Y'; const MONTHS = [ '01' => 'January', '02' => 'February', @@ -135,7 +134,7 @@ $uris = []; $pdo = new PDO("sqlite:mktplc.sqlite3"); - $stmt = $pdo->prepare("SELECT uri FROM songs s WHERE (SELECT strftime('%m', s.date) == :month and strftime('%Y', s.date) == :year;"); + $stmt = $pdo->prepare("SELECT uri FROM songs s WHERE uri IS NOT NULL AND strftime('%m', s.date) == :month AND strftime('%Y', s.date) == :year"); $stmt->bindParam(':month', $state[0]); $stmt->bindParam(':year', $state[1]); if ($stmt->execute()) { @@ -168,7 +167,4 @@ echo '
'; print_r(json_encode($update_data)); $update_req = file_get_contents(BASE_URL . 'users/' . $me_id . '/playlists/' . $playlistID . '/tracks', false, $update_context); - print_r($update_req); - - file_put_contents(DATE_FILE, $recentEpDT->format(DATE_FORM)); - \ No newline at end of file + print_r($update_req); \ No newline at end of file -- 2.20.1