diff --git a/scripts/store/setters/http_referrer.js b/scripts/store/setters/http_referrer.js new file mode 100644 index 0000000000..fdbb31c462 --- /dev/null +++ b/scripts/store/setters/http_referrer.js @@ -0,0 +1,3 @@ +module.exports = function ({ http_referrer }) { + return http_referrer || null +} diff --git a/scripts/store/setters/index.js b/scripts/store/setters/index.js index 612e6cc78d..454bb19ca7 100644 --- a/scripts/store/setters/index.js +++ b/scripts/store/setters/index.js @@ -4,3 +4,5 @@ exports.status = require('./status') exports.url = require('./url') exports.channel_name = require('./channel_name') exports.channel_id = require('./channel_id') +exports.http_referrer = require('./http_referrer') +exports.user_agent = require('./user_agent') diff --git a/scripts/store/setters/user_agent.js b/scripts/store/setters/user_agent.js new file mode 100644 index 0000000000..ccc0c0599c --- /dev/null +++ b/scripts/store/setters/user_agent.js @@ -0,0 +1,3 @@ +module.exports = function ({ user_agent }) { + return user_agent || null +} diff --git a/tests/__data__/expected/database/db_create.streams.db b/tests/__data__/expected/database/db_create.streams.db index c4fc74f15c..fb50691295 100644 --- a/tests/__data__/expected/database/db_create.streams.db +++ b/tests/__data__/expected/database/db_create.streams.db @@ -1,4 +1,4 @@ -{"channel":null,"title":"ABC (720p)","filepath":"tests/__data__/input/channels/wrong_id.m3u","url":"https://example.com/playlist2.m3u8","http_referrer":"","user_agent":"","cluster_id":1,"_id":"hrkAABqRIoVtOXd4"} -{"channel":null,"title":"Fox Sports 2 Asia (Thai) (720p)","filepath":"tests/__data__/input/channels/us_blocked.m3u","url":"https://example.com/playlist.m3u8","http_referrer":"","user_agent":"","cluster_id":1,"_id":"eeofJMxX7fOzDR9R"} -{"channel":null,"title":"1A Network (720p)","filepath":"tests/__data__/input/channels/unsorted.m3u","url":"https://simultv.s.llnwi.net/n4s4/2ANetwork/interlink.m3u8","http_referrer":"","user_agent":"","cluster_id":1,"_id":"omQ1KYCOKqb5Lxyn"} -{"channel":"ATV.ad","title":"ATV (720p) [Offline]","filepath":"tests/__data__/input/channels/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":"","user_agent":"","cluster_id":1,"_id":"v9O0SiMdhSh7wiKB"} +{"channel":null,"title":"1A Network (720p)","filepath":"tests/__data__/input/channels/unsorted.m3u","url":"https://simultv.s.llnwi.net/n4s4/2ANetwork/interlink.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"ZJejfvbOVTyuf6Gk"} +{"channel":null,"title":"Fox Sports 2 Asia (Thai) (720p)","filepath":"tests/__data__/input/channels/us_blocked.m3u","url":"https://example.com/playlist.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"gnjGLZU1CEz79gcp"} +{"channel":"ATV.ad","title":"ATV (720p) [Offline]","filepath":"tests/__data__/input/channels/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"9r9qmYRa2kxiirl0"} +{"channel":null,"title":"ABC (720p)","filepath":"tests/__data__/input/channels/wrong_id.m3u","url":"https://example.com/playlist2.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"unOCFJtsDCbJupxR"}