Skip to content
Snippets Groups Projects
Verified Commit ee9cc4d1 authored by Ole Binder's avatar Ole Binder
Browse files

Fix: update timeslot_id type to string

parent 2e0f6a89
No related branches found
No related tags found
No related merge requests found
...@@ -119,7 +119,7 @@ def build_metadata(json_string) = ...@@ -119,7 +119,7 @@ def build_metadata(json_string) =
{ {
show_name: string, show_name: string,
show_id: int, show_id: int,
timeslot_id: int, timeslot_id: string,
playlist_id: int, playlist_id: int,
playlist_item: string, playlist_item: string,
track_type: int, track_type: int,
...@@ -174,7 +174,7 @@ def post_playlog(api_url, data) = ...@@ -174,7 +174,7 @@ def post_playlog(api_url, data) =
json_data.add("showId", int_of_string(list.assoc("show_id", data))) json_data.add("showId", int_of_string(list.assoc("show_id", data)))
json_data.add("showName", list.assoc("show_name", data)) json_data.add("showName", list.assoc("show_name", data))
json_data.add("timeslotId", int_of_string(list.assoc("timeslot_id", data))) json_data.add("timeslotId", list.assoc("timeslot_id", data))
json_data.add("playlistId", int_of_string(list.assoc("playlist_id", data))) json_data.add("playlistId", int_of_string(list.assoc("playlist_id", data)))
json_data.add("trackType", int_of_string(list.assoc("track_type", data))) json_data.add("trackType", int_of_string(list.assoc("track_type", data)))
json_data.add("trackStart", list.assoc("track_start", data)) json_data.add("trackStart", list.assoc("track_start", data))
......
...@@ -24,7 +24,7 @@ in_line_insert_callbacks = ref([]) ...@@ -24,7 +24,7 @@ in_line_insert_callbacks = ref([])
usage_set_track_metadata = usage_set_track_metadata =
"set_track_metadata { \"show_name\": \"Analog Ambient\", \"show_id\": 111, \ "set_track_metadata { \"show_name\": \"Analog Ambient\", \"show_id\": 111, \
\"timeslot_id\": 222, \"playlist_id\": 333, \"playlist_item\": \"\", \ \"timeslot_id\": \"222\", \"playlist_id\": 333, \"playlist_item\": \"\", \
\"track_type\": 2, \"track_start\": \"2022/02/22 22:02:22\", \ \"track_type\": 2, \"track_start\": \"2022/02/22 22:02:22\", \
\"track_duration\": 808.8, \"track_title\": \"Lorem Ipsum\", \"track_album\": \ \"track_duration\": 808.8, \"track_title\": \"Lorem Ipsum\", \"track_album\": \
\"\", \"track_artist\": \"\" }" \"\", \"track_artist\": \"\" }"
......
...@@ -81,7 +81,7 @@ input_stream_1 = ...@@ -81,7 +81,7 @@ input_stream_1 =
usage_set_track_metadata = usage_set_track_metadata =
"set_track_metadata { \"show_name\": \"Laser Music 2000\", \"show_id\": 123, \ "set_track_metadata { \"show_name\": \"Laser Music 2000\", \"show_id\": 123, \
\"timeslot_id\": 123, \"playlist_id\": 123, \"playlist_item\": \"\", \ \"timeslot_id\": \"123\", \"playlist_id\": 123, \"playlist_item\": \"\", \
\"track_type\": 1, \"track_start\": \"2022/02/22 22:02:22\", \ \"track_type\": 1, \"track_start\": \"2022/02/22 22:02:22\", \
\"track_duration\": 303.3, \"track_title\": \"Bar\", \"track_album\": \"\", \ \"track_duration\": 303.3, \"track_title\": \"Bar\", \"track_album\": \"\", \
\"track_artist\": \"Foo\" }" \"track_artist\": \"Foo\" }"
......
...@@ -17,26 +17,22 @@ ...@@ -17,26 +17,22 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
%include "base_config.liq" %include "base_config.liq"
%include "../src/functions.liq" %include "../src/functions.liq"
json_string =
json_string = "{ \ "{ \"show_name\": \"Laser Music 2000\", \"show_id\": -1, \"timeslot_id\": \
\"show_name\": \"Laser Music 2000\", \ \"-1\", \"playlist_id\": -1, \"playlist_item\": \"\", \"track_type\": 0, \
\"show_id\": -1, \ \"track_start\": \"2022/02/22 22:02:22\", \"track_duration\": 303.3, \
\"timeslot_id\": -1, \ \"track_title\": \"FooBar 2000\", \"track_album\": \"\", \"track_artist\": \
\"playlist_id\": -1, \ \"\" }"
\"playlist_item\": \"\", \
\"track_type\": 0, \
\"track_start\": \"2022/02/22 22:02:22\", \
\"track_duration\": 303.3, \
\"track_title\": \"FooBar 2000\", \
\"track_album\": \"\", \
\"track_artist\": \"\" \
}"
metadata = build_metadata(json_string) metadata = build_metadata(json_string)
title = metadata["track_title"] title = metadata["track_title"]
print("Track title: #{title}") print(
assertEquals(title, "FooBar 2000") "Track title: #{title}"
)
assertEquals(
title,
"FooBar 2000"
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment