diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 529156469..d248d571c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -122,7 +122,7 @@ jobs: - name: Python tests run: | - pipenv run python -m pytest + pipenv run python -m pytest --log-level DEBUG - name: Build run: | diff --git a/Pipfile b/Pipfile index b803e7e59..d5b1eeb55 100644 --- a/Pipfile +++ b/Pipfile @@ -16,6 +16,7 @@ setuptools_scm = { version = ">=6.2", extras = ["toml"] } tomli = "*" pytest = "~=7.4" pytest-django = "~=3.10" +pytest-rerunfailures = "~=12.0" [packages] nodeenv = "==1.3.3" diff --git a/Pipfile.lock b/Pipfile.lock index af7d80f9d..153202f7c 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "8e50b828a65bb15ecce47ebd0143668cde8b5266112dc351e6a04055c1978ed5" + "sha256": "2fb4237dd4fb8a8f758ee395f171910347678442d57cc68b1b502aeeec09d8d1" }, "pipfile-spec": 6, "requires": { @@ -18,10 +18,10 @@ "default": { "asttokens": { "hashes": [ - "sha256:2e0171b991b2c959acc6c49318049236844a5da1d65ba2672c4880c1c894834e", - "sha256:cf8fc9e61a86461aa9fb161a14a0841a03c405fa829ac6b202670b3495d2ce69" + "sha256:051ed49c3dcae8913ea7cd08e46a606dba30b79993209636c4875bc1d637bc24", + "sha256:b03869718ba9a6eb027e134bfdf69f38a236d681c83c160d510768af11254ba0" ], - "version": "==2.4.0" + "version": "==2.4.1" }, "backcall": { "hashes": [ @@ -270,11 +270,11 @@ }, "traitlets": { "hashes": [ - "sha256:7564b5bf8d38c40fa45498072bf4dc5e8346eb087bbf1e2ae2d8774f6a0f078e", - "sha256:98277f247f18b2c5cabaf4af369187754f4fb0e85911d473f72329db8a7f4fae" + "sha256:81539f07f7aebcde2e4b5ab76727f53eabf18ad155c6ed7979a681411602fa47", + "sha256:833273bf645d8ce31dcb613c56999e2e055b1ffe6d09168a164bcd91c36d5d35" ], "markers": "python_version >= '3.8'", - "version": "==5.11.2" + "version": "==5.12.0" }, "typing-extensions": { "hashes": [ @@ -393,99 +393,99 @@ }, "charset-normalizer": { "hashes": [ - "sha256:02673e456dc5ab13659f85196c534dc596d4ef260e4d86e856c3b2773ce09843", - "sha256:02af06682e3590ab952599fbadac535ede5d60d78848e555aa58d0c0abbde786", - "sha256:03680bb39035fbcffe828eae9c3f8afc0428c91d38e7d61aa992ef7a59fb120e", - "sha256:0570d21da019941634a531444364f2482e8db0b3425fcd5ac0c36565a64142c8", - "sha256:09c77f964f351a7369cc343911e0df63e762e42bac24cd7d18525961c81754f4", - "sha256:0d3d5b7db9ed8a2b11a774db2bbea7ba1884430a205dbd54a32d61d7c2a190fa", - "sha256:1063da2c85b95f2d1a430f1c33b55c9c17ffaf5e612e10aeaad641c55a9e2b9d", - "sha256:12ebea541c44fdc88ccb794a13fe861cc5e35d64ed689513a5c03d05b53b7c82", - "sha256:153e7b6e724761741e0974fc4dcd406d35ba70b92bfe3fedcb497226c93b9da7", - "sha256:15b26ddf78d57f1d143bdf32e820fd8935d36abe8a25eb9ec0b5a71c82eb3895", - "sha256:1872d01ac8c618a8da634e232f24793883d6e456a66593135aeafe3784b0848d", - "sha256:187d18082694a29005ba2944c882344b6748d5be69e3a89bf3cc9d878e548d5a", - "sha256:1b2919306936ac6efb3aed1fbf81039f7087ddadb3160882a57ee2ff74fd2382", - "sha256:232ac332403e37e4a03d209a3f92ed9071f7d3dbda70e2a5e9cff1c4ba9f0678", - "sha256:23e8565ab7ff33218530bc817922fae827420f143479b753104ab801145b1d5b", - "sha256:24817cb02cbef7cd499f7c9a2735286b4782bd47a5b3516a0e84c50eab44b98e", - "sha256:249c6470a2b60935bafd1d1d13cd613f8cd8388d53461c67397ee6a0f5dce741", - "sha256:24a91a981f185721542a0b7c92e9054b7ab4fea0508a795846bc5b0abf8118d4", - "sha256:2502dd2a736c879c0f0d3e2161e74d9907231e25d35794584b1ca5284e43f596", - "sha256:250c9eb0f4600361dd80d46112213dff2286231d92d3e52af1e5a6083d10cad9", - "sha256:278c296c6f96fa686d74eb449ea1697f3c03dc28b75f873b65b5201806346a69", - "sha256:2935ffc78db9645cb2086c2f8f4cfd23d9b73cc0dc80334bc30aac6f03f68f8c", - "sha256:2f4a0033ce9a76e391542c182f0d48d084855b5fcba5010f707c8e8c34663d77", - "sha256:30a85aed0b864ac88309b7d94be09f6046c834ef60762a8833b660139cfbad13", - "sha256:380c4bde80bce25c6e4f77b19386f5ec9db230df9f2f2ac1e5ad7af2caa70459", - "sha256:3ae38d325b512f63f8da31f826e6cb6c367336f95e418137286ba362925c877e", - "sha256:3b447982ad46348c02cb90d230b75ac34e9886273df3a93eec0539308a6296d7", - "sha256:3debd1150027933210c2fc321527c2299118aa929c2f5a0a80ab6953e3bd1908", - "sha256:4162918ef3098851fcd8a628bf9b6a98d10c380725df9e04caf5ca6dd48c847a", - "sha256:468d2a840567b13a590e67dd276c570f8de00ed767ecc611994c301d0f8c014f", - "sha256:4cc152c5dd831641e995764f9f0b6589519f6f5123258ccaca8c6d34572fefa8", - "sha256:542da1178c1c6af8873e143910e2269add130a299c9106eef2594e15dae5e482", - "sha256:557b21a44ceac6c6b9773bc65aa1b4cc3e248a5ad2f5b914b91579a32e22204d", - "sha256:5707a746c6083a3a74b46b3a631d78d129edab06195a92a8ece755aac25a3f3d", - "sha256:588245972aca710b5b68802c8cad9edaa98589b1b42ad2b53accd6910dad3545", - "sha256:5adf257bd58c1b8632046bbe43ee38c04e1038e9d37de9c57a94d6bd6ce5da34", - "sha256:619d1c96099be5823db34fe89e2582b336b5b074a7f47f819d6b3a57ff7bdb86", - "sha256:63563193aec44bce707e0c5ca64ff69fa72ed7cf34ce6e11d5127555756fd2f6", - "sha256:67b8cc9574bb518ec76dc8e705d4c39ae78bb96237cb533edac149352c1f39fe", - "sha256:6a685067d05e46641d5d1623d7c7fdf15a357546cbb2f71b0ebde91b175ffc3e", - "sha256:70f1d09c0d7748b73290b29219e854b3207aea922f839437870d8cc2168e31cc", - "sha256:750b446b2ffce1739e8578576092179160f6d26bd5e23eb1789c4d64d5af7dc7", - "sha256:7966951325782121e67c81299a031f4c115615e68046f79b85856b86ebffc4cd", - "sha256:7b8b8bf1189b3ba9b8de5c8db4d541b406611a71a955bbbd7385bbc45fcb786c", - "sha256:7f5d10bae5d78e4551b7be7a9b29643a95aded9d0f602aa2ba584f0388e7a557", - "sha256:805dfea4ca10411a5296bcc75638017215a93ffb584c9e344731eef0dcfb026a", - "sha256:81bf654678e575403736b85ba3a7867e31c2c30a69bc57fe88e3ace52fb17b89", - "sha256:82eb849f085624f6a607538ee7b83a6d8126df6d2f7d3b319cb837b289123078", - "sha256:85a32721ddde63c9df9ebb0d2045b9691d9750cb139c161c80e500d210f5e26e", - "sha256:86d1f65ac145e2c9ed71d8ffb1905e9bba3a91ae29ba55b4c46ae6fc31d7c0d4", - "sha256:86f63face3a527284f7bb8a9d4f78988e3c06823f7bea2bd6f0e0e9298ca0403", - "sha256:8eaf82f0eccd1505cf39a45a6bd0a8cf1c70dcfc30dba338207a969d91b965c0", - "sha256:93aa7eef6ee71c629b51ef873991d6911b906d7312c6e8e99790c0f33c576f89", - "sha256:96c2b49eb6a72c0e4991d62406e365d87067ca14c1a729a870d22354e6f68115", - "sha256:9cf3126b85822c4e53aa28c7ec9869b924d6fcfb76e77a45c44b83d91afd74f9", - "sha256:9fe359b2e3a7729010060fbca442ca225280c16e923b37db0e955ac2a2b72a05", - "sha256:a0ac5e7015a5920cfce654c06618ec40c33e12801711da6b4258af59a8eff00a", - "sha256:a3f93dab657839dfa61025056606600a11d0b696d79386f974e459a3fbc568ec", - "sha256:a4b71f4d1765639372a3b32d2638197f5cd5221b19531f9245fcc9ee62d38f56", - "sha256:aae32c93e0f64469f74ccc730a7cb21c7610af3a775157e50bbd38f816536b38", - "sha256:aaf7b34c5bc56b38c931a54f7952f1ff0ae77a2e82496583b247f7c969eb1479", - "sha256:abecce40dfebbfa6abf8e324e1860092eeca6f7375c8c4e655a8afb61af58f2c", - "sha256:abf0d9f45ea5fb95051c8bfe43cb40cda383772f7e5023a83cc481ca2604d74e", - "sha256:ac71b2977fb90c35d41c9453116e283fac47bb9096ad917b8819ca8b943abecd", - "sha256:ada214c6fa40f8d800e575de6b91a40d0548139e5dc457d2ebb61470abf50186", - "sha256:b09719a17a2301178fac4470d54b1680b18a5048b481cb8890e1ef820cb80455", - "sha256:b1121de0e9d6e6ca08289583d7491e7fcb18a439305b34a30b20d8215922d43c", - "sha256:b3b2316b25644b23b54a6f6401074cebcecd1244c0b8e80111c9a3f1c8e83d65", - "sha256:b3d9b48ee6e3967b7901c052b670c7dda6deb812c309439adaffdec55c6d7b78", - "sha256:b5bcf60a228acae568e9911f410f9d9e0d43197d030ae5799e20dca8df588287", - "sha256:b8f3307af845803fb0b060ab76cf6dd3a13adc15b6b451f54281d25911eb92df", - "sha256:c2af80fb58f0f24b3f3adcb9148e6203fa67dd3f61c4af146ecad033024dde43", - "sha256:c350354efb159b8767a6244c166f66e67506e06c8924ed74669b2c70bc8735b1", - "sha256:c5a74c359b2d47d26cdbbc7845e9662d6b08a1e915eb015d044729e92e7050b7", - "sha256:c71f16da1ed8949774ef79f4a0260d28b83b3a50c6576f8f4f0288d109777989", - "sha256:d47ecf253780c90ee181d4d871cd655a789da937454045b17b5798da9393901a", - "sha256:d7eff0f27edc5afa9e405f7165f85a6d782d308f3b6b9d96016c010597958e63", - "sha256:d97d85fa63f315a8bdaba2af9a6a686e0eceab77b3089af45133252618e70884", - "sha256:db756e48f9c5c607b5e33dd36b1d5872d0422e960145b08ab0ec7fd420e9d649", - "sha256:dc45229747b67ffc441b3de2f3ae5e62877a282ea828a5bdb67883c4ee4a8810", - "sha256:e0fc42822278451bc13a2e8626cf2218ba570f27856b536e00cfa53099724828", - "sha256:e39c7eb31e3f5b1f88caff88bcff1b7f8334975b46f6ac6e9fc725d829bc35d4", - "sha256:e46cd37076971c1040fc8c41273a8b3e2c624ce4f2be3f5dfcb7a430c1d3acc2", - "sha256:e5c1502d4ace69a179305abb3f0bb6141cbe4714bc9b31d427329a95acfc8bdd", - "sha256:edfe077ab09442d4ef3c52cb1f9dab89bff02f4524afc0acf2d46be17dc479f5", - "sha256:effe5406c9bd748a871dbcaf3ac69167c38d72db8c9baf3ff954c344f31c4cbe", - "sha256:f0d1e3732768fecb052d90d62b220af62ead5748ac51ef61e7b32c266cac9293", - "sha256:f5969baeaea61c97efa706b9b107dcba02784b1601c74ac84f2a532ea079403e", - "sha256:f8888e31e3a85943743f8fc15e71536bda1c81d5aa36d014a3c0c44481d7db6e", - "sha256:fc52b79d83a3fe3a360902d3f5d79073a993597d48114c29485e9431092905d8" + "sha256:06cf46bdff72f58645434d467bf5228080801298fbba19fe268a01b4534467f5", + "sha256:0c8c61fb505c7dad1d251c284e712d4e0372cef3b067f7ddf82a7fa82e1e9a93", + "sha256:10b8dd31e10f32410751b3430996f9807fc4d1587ca69772e2aa940a82ab571a", + "sha256:1171ef1fc5ab4693c5d151ae0fdad7f7349920eabbaca6271f95969fa0756c2d", + "sha256:17a866d61259c7de1bdadef418a37755050ddb4b922df8b356503234fff7932c", + "sha256:1d6bfc32a68bc0933819cfdfe45f9abc3cae3877e1d90aac7259d57e6e0f85b1", + "sha256:1ec937546cad86d0dce5396748bf392bb7b62a9eeb8c66efac60e947697f0e58", + "sha256:223b4d54561c01048f657fa6ce41461d5ad8ff128b9678cfe8b2ecd951e3f8a2", + "sha256:2465aa50c9299d615d757c1c888bc6fef384b7c4aec81c05a0172b4400f98557", + "sha256:28f512b9a33235545fbbdac6a330a510b63be278a50071a336afc1b78781b147", + "sha256:2c092be3885a1b7899cd85ce24acedc1034199d6fca1483fa2c3a35c86e43041", + "sha256:2c4c99f98fc3a1835af8179dcc9013f93594d0670e2fa80c83aa36346ee763d2", + "sha256:31445f38053476a0c4e6d12b047b08ced81e2c7c712e5a1ad97bc913256f91b2", + "sha256:31bbaba7218904d2eabecf4feec0d07469284e952a27400f23b6628439439fa7", + "sha256:34d95638ff3613849f473afc33f65c401a89f3b9528d0d213c7037c398a51296", + "sha256:352a88c3df0d1fa886562384b86f9a9e27563d4704ee0e9d56ec6fcd270ea690", + "sha256:39b70a6f88eebe239fa775190796d55a33cfb6d36b9ffdd37843f7c4c1b5dc67", + "sha256:3c66df3f41abee950d6638adc7eac4730a306b022570f71dd0bd6ba53503ab57", + "sha256:3f70fd716855cd3b855316b226a1ac8bdb3caf4f7ea96edcccc6f484217c9597", + "sha256:3f9bc2ce123637a60ebe819f9fccc614da1bcc05798bbbaf2dd4ec91f3e08846", + "sha256:3fb765362688821404ad6cf86772fc54993ec11577cd5a92ac44b4c2ba52155b", + "sha256:45f053a0ece92c734d874861ffe6e3cc92150e32136dd59ab1fb070575189c97", + "sha256:46fb9970aa5eeca547d7aa0de5d4b124a288b42eaefac677bde805013c95725c", + "sha256:4cb50a0335382aac15c31b61d8531bc9bb657cfd848b1d7158009472189f3d62", + "sha256:4e12f8ee80aa35e746230a2af83e81bd6b52daa92a8afaef4fea4a2ce9b9f4fa", + "sha256:4f3100d86dcd03c03f7e9c3fdb23d92e32abbca07e7c13ebd7ddfbcb06f5991f", + "sha256:4f6e2a839f83a6a76854d12dbebde50e4b1afa63e27761549d006fa53e9aa80e", + "sha256:4f861d94c2a450b974b86093c6c027888627b8082f1299dfd5a4bae8e2292821", + "sha256:501adc5eb6cd5f40a6f77fbd90e5ab915c8fd6e8c614af2db5561e16c600d6f3", + "sha256:520b7a142d2524f999447b3a0cf95115df81c4f33003c51a6ab637cbda9d0bf4", + "sha256:548eefad783ed787b38cb6f9a574bd8664468cc76d1538215d510a3cd41406cb", + "sha256:555fe186da0068d3354cdf4bbcbc609b0ecae4d04c921cc13e209eece7720727", + "sha256:55602981b2dbf8184c098bc10287e8c245e351cd4fdcad050bd7199d5a8bf514", + "sha256:58e875eb7016fd014c0eea46c6fa92b87b62c0cb31b9feae25cbbe62c919f54d", + "sha256:5a3580a4fdc4ac05f9e53c57f965e3594b2f99796231380adb2baaab96e22761", + "sha256:5b70bab78accbc672f50e878a5b73ca692f45f5b5e25c8066d748c09405e6a55", + "sha256:5ceca5876032362ae73b83347be8b5dbd2d1faf3358deb38c9c88776779b2e2f", + "sha256:61f1e3fb621f5420523abb71f5771a204b33c21d31e7d9d86881b2cffe92c47c", + "sha256:633968254f8d421e70f91c6ebe71ed0ab140220469cf87a9857e21c16687c034", + "sha256:63a6f59e2d01310f754c270e4a257426fe5a591dc487f1983b3bbe793cf6bac6", + "sha256:63accd11149c0f9a99e3bc095bbdb5a464862d77a7e309ad5938fbc8721235ae", + "sha256:6db3cfb9b4fcecb4390db154e75b49578c87a3b9979b40cdf90d7e4b945656e1", + "sha256:71ef3b9be10070360f289aea4838c784f8b851be3ba58cf796262b57775c2f14", + "sha256:7ae8e5142dcc7a49168f4055255dbcced01dc1714a90a21f87448dc8d90617d1", + "sha256:7b6cefa579e1237ce198619b76eaa148b71894fb0d6bcf9024460f9bf30fd228", + "sha256:800561453acdecedaac137bf09cd719c7a440b6800ec182f077bb8e7025fb708", + "sha256:82ca51ff0fc5b641a2d4e1cc8c5ff108699b7a56d7f3ad6f6da9dbb6f0145b48", + "sha256:851cf693fb3aaef71031237cd68699dded198657ec1e76a76eb8be58c03a5d1f", + "sha256:854cc74367180beb327ab9d00f964f6d91da06450b0855cbbb09187bcdb02de5", + "sha256:87071618d3d8ec8b186d53cb6e66955ef2a0e4fa63ccd3709c0c90ac5a43520f", + "sha256:871d045d6ccc181fd863a3cd66ee8e395523ebfbc57f85f91f035f50cee8e3d4", + "sha256:8aee051c89e13565c6bd366813c386939f8e928af93c29fda4af86d25b73d8f8", + "sha256:8af5a8917b8af42295e86b64903156b4f110a30dca5f3b5aedea123fbd638bff", + "sha256:8ec8ef42c6cd5856a7613dcd1eaf21e5573b2185263d87d27c8edcae33b62a61", + "sha256:91e43805ccafa0a91831f9cd5443aa34528c0c3f2cc48c4cb3d9a7721053874b", + "sha256:9505dc359edb6a330efcd2be825fdb73ee3e628d9010597aa1aee5aa63442e97", + "sha256:985c7965f62f6f32bf432e2681173db41336a9c2611693247069288bcb0c7f8b", + "sha256:9a74041ba0bfa9bc9b9bb2cd3238a6ab3b7618e759b41bd15b5f6ad958d17605", + "sha256:9edbe6a5bf8b56a4a84533ba2b2f489d0046e755c29616ef8830f9e7d9cf5728", + "sha256:a15c1fe6d26e83fd2e5972425a772cca158eae58b05d4a25a4e474c221053e2d", + "sha256:a66bcdf19c1a523e41b8e9d53d0cedbfbac2e93c649a2e9502cb26c014d0980c", + "sha256:ae4070f741f8d809075ef697877fd350ecf0b7c5837ed68738607ee0a2c572cf", + "sha256:ae55d592b02c4349525b6ed8f74c692509e5adffa842e582c0f861751701a673", + "sha256:b578cbe580e3b41ad17b1c428f382c814b32a6ce90f2d8e39e2e635d49e498d1", + "sha256:b891a2f68e09c5ef989007fac11476ed33c5c9994449a4e2c3386529d703dc8b", + "sha256:baec8148d6b8bd5cee1ae138ba658c71f5b03e0d69d5907703e3e1df96db5e41", + "sha256:bb06098d019766ca16fc915ecaa455c1f1cd594204e7f840cd6258237b5079a8", + "sha256:bc791ec3fd0c4309a753f95bb6c749ef0d8ea3aea91f07ee1cf06b7b02118f2f", + "sha256:bd28b31730f0e982ace8663d108e01199098432a30a4c410d06fe08fdb9e93f4", + "sha256:be4d9c2770044a59715eb57c1144dedea7c5d5ae80c68fb9959515037cde2008", + "sha256:c0c72d34e7de5604df0fde3644cc079feee5e55464967d10b24b1de268deceb9", + "sha256:c0e842112fe3f1a4ffcf64b06dc4c61a88441c2f02f373367f7b4c1aa9be2ad5", + "sha256:c15070ebf11b8b7fd1bfff7217e9324963c82dbdf6182ff7050519e350e7ad9f", + "sha256:c2000c54c395d9e5e44c99dc7c20a64dc371f777faf8bae4919ad3e99ce5253e", + "sha256:c30187840d36d0ba2893bc3271a36a517a717f9fd383a98e2697ee890a37c273", + "sha256:cb7cd68814308aade9d0c93c5bd2ade9f9441666f8ba5aa9c2d4b389cb5e2a45", + "sha256:cd805513198304026bd379d1d516afbf6c3c13f4382134a2c526b8b854da1c2e", + "sha256:d0bf89afcbcf4d1bb2652f6580e5e55a840fdf87384f6063c4a4f0c95e378656", + "sha256:d9137a876020661972ca6eec0766d81aef8a5627df628b664b234b73396e727e", + "sha256:dbd95e300367aa0827496fe75a1766d198d34385a58f97683fe6e07f89ca3e3c", + "sha256:dced27917823df984fe0c80a5c4ad75cf58df0fbfae890bc08004cd3888922a2", + "sha256:de0b4caa1c8a21394e8ce971997614a17648f94e1cd0640fbd6b4d14cab13a72", + "sha256:debb633f3f7856f95ad957d9b9c781f8e2c6303ef21724ec94bea2ce2fcbd056", + "sha256:e372d7dfd154009142631de2d316adad3cc1c36c32a38b16a4751ba78da2a397", + "sha256:ecd26be9f112c4f96718290c10f4caea6cc798459a3a76636b817a0ed7874e42", + "sha256:edc0202099ea1d82844316604e17d2b175044f9bcb6b398aab781eba957224bd", + "sha256:f194cce575e59ffe442c10a360182a986535fd90b57f7debfaa5c845c409ecc3", + "sha256:f5fb672c396d826ca16a022ac04c9dce74e00a1c344f6ad1a0fdc1ba1f332213", + "sha256:f6a02a3c7950cafaadcd46a226ad9e12fc9744652cc69f9e5534f98b47f3bbcf", + "sha256:fe81b35c33772e56f4b6cf62cf4aedc1762ef7162a31e6ac7fe5e40d0149eb67" ], "markers": "python_full_version >= '3.7.0'", - "version": "==3.3.0" + "version": "==3.3.1" }, "cryptography": { "hashes": [ @@ -750,11 +750,11 @@ }, "pytest": { "hashes": [ - "sha256:1d881c6124e08ff0a1bb75ba3ec0bfd8b5354a01c194ddd5a0a870a48d99b002", - "sha256:a766259cfab564a2ad52cb1aae1b881a75c3eb7e34ca3779697c23ed47c47069" + "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac", + "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5" ], "index": "pypi", - "version": "==7.4.2" + "version": "==7.4.3" }, "pytest-django": { "hashes": [ @@ -764,6 +764,14 @@ "index": "pypi", "version": "==3.10.0" }, + "pytest-rerunfailures": { + "hashes": [ + "sha256:784f462fa87fe9bdf781d0027d856b47a4bfe6c12af108f6bd887057a917b48e", + "sha256:9a1afd04e21b8177faf08a9bbbf44de7a0fe3fc29f8ddbe83b9684bd5f8f92a9" + ], + "index": "pypi", + "version": "==12.0" + }, "pyyaml": { "hashes": [ "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5", @@ -921,19 +929,19 @@ }, "urllib3": { "hashes": [ - "sha256:7a7c7003b000adf9e7ca2a377c9688bbc54ed41b985789ed576570342a375cd2", - "sha256:b19e1a85d206b56d7df1d5e683df4a7725252a964e3993648dd0fb5a1c157564" + "sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84", + "sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e" ], "markers": "python_version >= '3.7'", - "version": "==2.0.6" + "version": "==2.0.7" }, "virtualenv": { "hashes": [ - "sha256:b80039f280f4919c77b30f1c23294ae357c4c8701042086e3fc005963e4e537b", - "sha256:e8361967f6da6fbdf1426483bfe9fca8287c242ac0bc30429905721cefbff752" + "sha256:02ece4f56fbf939dbbc33c0715159951d6bf14aaf5457b092e4548e1382455af", + "sha256:520d056652454c5098a00c0f073611ccbea4c79089331f60bf9d7ba247bb7381" ], "markers": "python_version >= '3.7'", - "version": "==20.24.5" + "version": "==20.24.6" }, "wheel": { "hashes": [ diff --git a/kolibri_explore_plugin/collectionviews.py b/kolibri_explore_plugin/collectionviews.py index 6da0740ff..1b172a13e 100644 --- a/kolibri_explore_plugin/collectionviews.py +++ b/kolibri_explore_plugin/collectionviews.py @@ -192,7 +192,9 @@ def get_contentthumbnail_tasks(self): For all the channels in this content manifest. """ return [ - get_remotecontentimport_task(channel_id, all_thumbnails=True) + get_remotecontentimport_task( + channel_id, node_ids=[], all_thumbnails=True + ) for channel_id in self.get_channel_ids() ] diff --git a/kolibri_explore_plugin/jobs.py b/kolibri_explore_plugin/jobs.py index 2041baf44..e384cd88f 100644 --- a/kolibri_explore_plugin/jobs.py +++ b/kolibri_explore_plugin/jobs.py @@ -11,6 +11,7 @@ from kolibri.core.tasks.job import State from kolibri.core.tasks.main import job_storage from kolibri.core.tasks.utils import import_path_to_callable +from kolibri.core.utils.lock import db_lock from .models import BackgroundTask @@ -70,8 +71,6 @@ def get_remotecontentimport_task( if not channel_name: channel_metadata = get_channel_metadata(channel_id) channel_name = channel_metadata.name - if node_ids is None: - node_ids = [] return { "task": TaskType.REMOTECONTENTIMPORT, "params": { @@ -104,7 +103,10 @@ def enqueue_task( def enqueue_next_background_task(): - """Locate the next background task and enqueue it for running""" + """Locate the next background task and enqueue it for running + + Returns the enqueued BackgroundTask or None if no task was enqueued. + """ # If there's already a job in progress, do nothing. We only want a # single background task running in order to not slow down the user @@ -117,26 +119,35 @@ def enqueue_next_background_task(): ) if in_progress_jobs.exists(): logger.debug("Not enqueuing next task as tasks in progress") - return + return None task = BackgroundTask.objects.filter(job_id="").first() if not task: logger.debug("All background tasks completed") - return + return None + # If the enqueued job changes state before the job ID has been recorded, + # the storage hook will skip the event since it won't find the background + # atask. Lock the database until that happens to prevent the storage hook + # from reading the BackgroundTask table. logger.info(f"Starting BackgroundTask {task}") params = json.loads(task.params) - job_id = enqueue_task( - task.func, - queue=BACKGROUND_QUEUE, - priority=Priority.REGULAR, - **params, - ) - task.update_job_id(job_id) + with db_lock(): + job_id = enqueue_task( + task.func, + queue=BACKGROUND_QUEUE, + priority=Priority.REGULAR, + **params, + ) + task.update_job_id(job_id) + + return task def storage_update_hook(job, orm_job, state=None, **kwargs): """StorageHook update hook""" + logger.debug(f"Running storage hook for {job}") + if state is None: # We only care about state transitions here. return @@ -149,6 +160,7 @@ def storage_update_hook(job, orm_job, state=None, **kwargs): # Synchronize the state if needed. if bg_task.job_state != state: + logger.debug(f"Updating {bg_task} job state to {state}") bg_task.job_state = state bg_task.save() @@ -165,7 +177,7 @@ def storage_update_hook(job, orm_job, state=None, **kwargs): bg_task_params = json.loads(bg_task.params) channel_id = bg_task_params["channel_id"] thumbnail_task_data = get_remotecontentimport_task( - channel_id, all_thumbnails=True + channel_id, node_ids=[], all_thumbnails=True ) BackgroundTask.create_from_task_data(thumbnail_task_data) diff --git a/kolibri_explore_plugin/models.py b/kolibri_explore_plugin/models.py index 9f39eab08..933c4f307 100644 --- a/kolibri_explore_plugin/models.py +++ b/kolibri_explore_plugin/models.py @@ -77,6 +77,7 @@ def create_from_task_data(cls, task_data): def update_job_id(self, job_id): """Set a new job ID and reset the state to PENDING""" + logger.debug(f"Updating {self} job ID to {job_id}") self.job_id = job_id self.job_state = State.PENDING self.save() diff --git a/kolibri_explore_plugin/test/channels/1af9e59af51f4c27a145433b83e3cea2.json b/kolibri_explore_plugin/test/channels/1af9e59af51f4c27a145433b83e3cea2.json new file mode 100644 index 000000000..84c5068fe --- /dev/null +++ b/kolibri_explore_plugin/test/channels/1af9e59af51f4c27a145433b83e3cea2.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "1af9e59af51f4c27a145433b83e3cea2", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "1af9e59af51f4c27a145433b83e3cea2", + "tagline": null, + "thumbnail": "data:image/jpg;base64,YFR0Xw2ZaiN0uP8HZK5h2vnyRGz81VmsOGoYt+8B", + "version": 4 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "1af9e59af51f4c27a145433b83e3cea2", + "coach_content": false, + "content_id": "1af9e59af51f4c27a145433b83e3cea2", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "1af9e59af51f4c27a145433b83e3cea2", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "1af9e59af51f4c27a145433b83e3cea2", + "coach_content": false, + "content_id": "d42f542d38b944219ae43349d0f089e1", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "305cce826f5645abb072b82961048ae4", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "1af9e59af51f4c27a145433b83e3cea2", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "1af9e59af51f4c27a145433b83e3cea2", + "coach_content": false, + "content_id": "b0e5f9d219754ea0b95a7191cb07321e", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "569e35021c0e4544a14e9407a7183957", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "1af9e59af51f4c27a145433b83e3cea2", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "1af9e59af51f4c27a145433b83e3cea2", + "coach_content": false, + "content_id": "6b343565d0a0490f845288172abfa9af", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "0f800a2aebff47afbdbcde5840659eb9", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "569e35021c0e4544a14e9407a7183957", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "1af9e59af51f4c27a145433b83e3cea2", + "coach_content": false, + "content_id": "880eb0b923994c4db50264176df35937", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "2e9f1c47b00847ab859f27fa216adcce", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "569e35021c0e4544a14e9407a7183957", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "1af9e59af51f4c27a145433b83e3cea2", + "coach_content": false, + "content_id": "e3b90571e2844a0e9435c332520351bb", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "548926d2da514702982af36165e48174", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "569e35021c0e4544a14e9407a7183957", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "305cce826f5645abb072b82961048ae4", + "id": 1, + "to_contentnode_id": "1af9e59af51f4c27a145433b83e3cea2" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "305cce826f5645abb072b82961048ae4", + "id": 1, + "to_contentnode_id": "569e35021c0e4544a14e9407a7183957" + }, + { + "from_contentnode_id": "569e35021c0e4544a14e9407a7183957", + "id": 2, + "to_contentnode_id": "305cce826f5645abb072b82961048ae4" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "1af9e59af51f4c27a145433b83e3cea2", + "contenttag_id": "a03e76e274fe495285407cf1a911f4e8", + "id": 1 + }, + { + "contentnode_id": "1af9e59af51f4c27a145433b83e3cea2", + "contenttag_id": "d8d3784bc5894aea98283a30a86d3e7d", + "id": 2 + }, + { + "contentnode_id": "1af9e59af51f4c27a145433b83e3cea2", + "contenttag_id": "425d4bfab7a6497c93f35e31a526feee", + "id": 3 + }, + { + "contentnode_id": "305cce826f5645abb072b82961048ae4", + "contenttag_id": "a03e76e274fe495285407cf1a911f4e8", + "id": 4 + }, + { + "contentnode_id": "569e35021c0e4544a14e9407a7183957", + "contenttag_id": "d8d3784bc5894aea98283a30a86d3e7d", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "a03e76e274fe495285407cf1a911f4e8", + "tag_name": "tag_1" + }, + { + "id": "d8d3784bc5894aea98283a30a86d3e7d", + "tag_name": "tag_2" + }, + { + "id": "425d4bfab7a6497c93f35e31a526feee", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "305cce826f5645abb072b82961048ae4", + "id": "1d40263dec9c46ccb858c5c2e9bf727e", + "lang_id": "en", + "local_file_id": "afb990cbf2d0e0a9ae75ba2f2f3bb013", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "305cce826f5645abb072b82961048ae4", + "id": "1bd3600b2e984616a48c57237d07346f", + "lang_id": "en", + "local_file_id": "462401eb22769f7a752d33955247ed86", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "305cce826f5645abb072b82961048ae4", + "id": "10bd1c51cf59466a8b782592a66a6072", + "lang_id": null, + "local_file_id": "0380b3d49382049c296426740ae500ec", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "305cce826f5645abb072b82961048ae4", + "id": "75a9463170ad4011b4bf3e0383499e66", + "lang_id": null, + "local_file_id": "b222b08c89c218d6abb703c259fd223b", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "569e35021c0e4544a14e9407a7183957", + "id": "00ea0d69e1db47d0afca04bce02911c0", + "lang_id": null, + "local_file_id": "1be4ac50b267e71d41fc894533a21baa", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "0f800a2aebff47afbdbcde5840659eb9", + "id": "81d7126bbaa74b8994ad8a194d3ad21d", + "lang_id": "3", + "local_file_id": "e73bb83093e95499840d50d89b80102a", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "0f800a2aebff47afbdbcde5840659eb9", + "id": "e326421c33a44b4192b4a577b3f59898", + "lang_id": null, + "local_file_id": "405965e83a681d31a7551e3c674140c7", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "2e9f1c47b00847ab859f27fa216adcce", + "id": "cfa2c5d9019d4a859e04282bd2740e92", + "lang_id": null, + "local_file_id": "35dbfbf1380acc184a9c50c270ea07ba", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "2e9f1c47b00847ab859f27fa216adcce", + "id": "58e70f784eb44658b295c385929b1098", + "lang_id": null, + "local_file_id": "767934cc5648bc414e5432f7aa3e6e55", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "548926d2da514702982af36165e48174", + "id": "030cb35189ee41e8bd598b1ee5542256", + "lang_id": null, + "local_file_id": "51f4ac2af2487bb32d14e4c3754009d2", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "3g==", + "available": false, + "extension": "mp4", + "file_size": 1, + "id": "afb990cbf2d0e0a9ae75ba2f2f3bb013" + }, + { + "_content": "VU/f5o1VO6q1SGIIP25ykJJGROUMY9h9", + "available": false, + "extension": "mp4", + "file_size": 24, + "id": "462401eb22769f7a752d33955247ed86" + }, + { + "_content": "x7o=", + "available": false, + "extension": "vtt", + "file_size": 2, + "id": "0380b3d49382049c296426740ae500ec" + }, + { + "_content": "oo5Fa4yfFdrXMpM=", + "available": false, + "extension": "png", + "file_size": 11, + "id": "b222b08c89c218d6abb703c259fd223b" + }, + { + "_content": "mFgB/3XZtw==", + "available": false, + "extension": "jpeg", + "file_size": 7, + "id": "1be4ac50b267e71d41fc894533a21baa" + }, + { + "_content": "32OcZ5ELPM4NtUZaRQBYoKi6aRjeGX0i/Hqhbg==", + "available": false, + "extension": "zip", + "file_size": 28, + "id": "e73bb83093e95499840d50d89b80102a" + }, + { + "_content": "8mrLax7zFhoG9+uhO2BNgIdX", + "available": false, + "extension": "jpeg", + "file_size": 18, + "id": "405965e83a681d31a7551e3c674140c7" + }, + { + "_content": "oip/aB9jyerPMyzmRw==", + "available": false, + "extension": "epub", + "file_size": 13, + "id": "35dbfbf1380acc184a9c50c270ea07ba" + }, + { + "_content": "ymbgXSy9DdtjuK4+rw3/8wnCu/SxXVU+", + "available": false, + "extension": "png", + "file_size": 24, + "id": "767934cc5648bc414e5432f7aa3e6e55" + }, + { + "_content": "fAwD2wK2FaWng3ncDp75cX0PrgduIU5kBrM=", + "available": false, + "extension": "mp3", + "file_size": 26, + "id": "51f4ac2af2487bb32d14e4c3754009d2" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/1d11cf118c3d4691907a6abb880b7c20.json b/kolibri_explore_plugin/test/channels/1d11cf118c3d4691907a6abb880b7c20.json new file mode 100644 index 000000000..9d78dd5e1 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/1d11cf118c3d4691907a6abb880b7c20.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "1d11cf118c3d4691907a6abb880b7c20", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "1d11cf118c3d4691907a6abb880b7c20", + "tagline": null, + "thumbnail": "data:image/jpg;base64,9h1wsuJkaJqRn0hInoSZZb/yhOCa6EzTC+DDBwae", + "version": 3 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "1d11cf118c3d4691907a6abb880b7c20", + "coach_content": false, + "content_id": "1d11cf118c3d4691907a6abb880b7c20", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "1d11cf118c3d4691907a6abb880b7c20", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "1d11cf118c3d4691907a6abb880b7c20", + "coach_content": false, + "content_id": "ed08a360171b413e9d720a97ae7bfe6e", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "3faff591666c475eb9495f962e36d95a", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "1d11cf118c3d4691907a6abb880b7c20", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "1d11cf118c3d4691907a6abb880b7c20", + "coach_content": false, + "content_id": "eab3fe1d30e14c498bf7b7cfa9cd7767", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "0fe9e1b844b64c9a8901b6a84ed18485", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "1d11cf118c3d4691907a6abb880b7c20", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "1d11cf118c3d4691907a6abb880b7c20", + "coach_content": false, + "content_id": "c7e42a02c89946d3b64bd3cc0ed15295", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "250196dd4f20439494a057ec1a024544", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "0fe9e1b844b64c9a8901b6a84ed18485", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "1d11cf118c3d4691907a6abb880b7c20", + "coach_content": false, + "content_id": "141293f020074d65ad9f7e70ca340985", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "89bfe3ddf45d4d3e864e2b71a08a99f4", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "0fe9e1b844b64c9a8901b6a84ed18485", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "1d11cf118c3d4691907a6abb880b7c20", + "coach_content": false, + "content_id": "49f076811b4c4383b9bd6016456432d3", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "be6b80bac60345b994dcb4a8785be78e", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "0fe9e1b844b64c9a8901b6a84ed18485", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "3faff591666c475eb9495f962e36d95a", + "id": 1, + "to_contentnode_id": "1d11cf118c3d4691907a6abb880b7c20" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "3faff591666c475eb9495f962e36d95a", + "id": 1, + "to_contentnode_id": "0fe9e1b844b64c9a8901b6a84ed18485" + }, + { + "from_contentnode_id": "0fe9e1b844b64c9a8901b6a84ed18485", + "id": 2, + "to_contentnode_id": "3faff591666c475eb9495f962e36d95a" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "1d11cf118c3d4691907a6abb880b7c20", + "contenttag_id": "aaf7c1a682104687b57984cb0a38d7fa", + "id": 1 + }, + { + "contentnode_id": "1d11cf118c3d4691907a6abb880b7c20", + "contenttag_id": "ef8e54df1832439bbe02f0856ed2f3b3", + "id": 2 + }, + { + "contentnode_id": "1d11cf118c3d4691907a6abb880b7c20", + "contenttag_id": "b7b6da4c77cb4bd1ab843f6867b09f56", + "id": 3 + }, + { + "contentnode_id": "3faff591666c475eb9495f962e36d95a", + "contenttag_id": "aaf7c1a682104687b57984cb0a38d7fa", + "id": 4 + }, + { + "contentnode_id": "0fe9e1b844b64c9a8901b6a84ed18485", + "contenttag_id": "ef8e54df1832439bbe02f0856ed2f3b3", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "aaf7c1a682104687b57984cb0a38d7fa", + "tag_name": "tag_1" + }, + { + "id": "ef8e54df1832439bbe02f0856ed2f3b3", + "tag_name": "tag_2" + }, + { + "id": "b7b6da4c77cb4bd1ab843f6867b09f56", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "3faff591666c475eb9495f962e36d95a", + "id": "dc4b5bd5690249cc8bfc817b84036f5b", + "lang_id": "en", + "local_file_id": "d81fd9b26fd0e89a61b65229aac286e5", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "3faff591666c475eb9495f962e36d95a", + "id": "0bee4e15b972435b92ddffdce4c8cccd", + "lang_id": "en", + "local_file_id": "1caac68fdb187a484ab8b115f476c689", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "3faff591666c475eb9495f962e36d95a", + "id": "53380a3560fa4946aefe17759388a7ce", + "lang_id": null, + "local_file_id": "fd55d16eb27b4a998f2594e7b78679de", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "3faff591666c475eb9495f962e36d95a", + "id": "986a94a8c5c747bb89c0a19631cbe727", + "lang_id": null, + "local_file_id": "214063bb27e2cee06ccddef7856ca17c", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "0fe9e1b844b64c9a8901b6a84ed18485", + "id": "c78b3742cb4a45c08893fd9ac8f7a595", + "lang_id": null, + "local_file_id": "5f336de400397931b4ce02daf652c60c", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "250196dd4f20439494a057ec1a024544", + "id": "7c179c4357d4455a89a36cf3d1f48346", + "lang_id": "3", + "local_file_id": "d60af20fe1a292accb263209fe91342e", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "250196dd4f20439494a057ec1a024544", + "id": "3ecb4a8739c74ec39280134e6bc70c39", + "lang_id": null, + "local_file_id": "75be55cc5a6051d42b07a50dab7fd348", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "89bfe3ddf45d4d3e864e2b71a08a99f4", + "id": "f75bb3e2c399464ea3efc888725faa09", + "lang_id": null, + "local_file_id": "3d4cd09285158e82dcdea6741857d49f", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "89bfe3ddf45d4d3e864e2b71a08a99f4", + "id": "112283b9839a4a6985a93bdc671e0959", + "lang_id": null, + "local_file_id": "6271f9a794b77dae82d8f6213a783912", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "be6b80bac60345b994dcb4a8785be78e", + "id": "dee81826bf674d5ea11d32be3401416c", + "lang_id": null, + "local_file_id": "ffe51d3e7d8297237588704eeddc6ab2", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "4g==", + "available": false, + "extension": "mp4", + "file_size": 1, + "id": "d81fd9b26fd0e89a61b65229aac286e5" + }, + { + "_content": "P62jNsptXEaRcUzG5Gh/kRVdtUz1w8PP", + "available": false, + "extension": "mp4", + "file_size": 24, + "id": "1caac68fdb187a484ab8b115f476c689" + }, + { + "_content": "TzkpiGp2WqkoF4XMx+zV9aJPhZlYfTv2DQ==", + "available": false, + "extension": "vtt", + "file_size": 25, + "id": "fd55d16eb27b4a998f2594e7b78679de" + }, + { + "_content": "Z+0IWDX4yADUQgsKsYSEFjmIky/kNZdQrnZrHc3v", + "available": false, + "extension": "png", + "file_size": 30, + "id": "214063bb27e2cee06ccddef7856ca17c" + }, + { + "_content": "gHv4P7OAxgiqrEU=", + "available": false, + "extension": "jpeg", + "file_size": 11, + "id": "5f336de400397931b4ce02daf652c60c" + }, + { + "_content": "3pCKQF5z3VVeGNEa2poflcauI5c=", + "available": false, + "extension": "zip", + "file_size": 20, + "id": "d60af20fe1a292accb263209fe91342e" + }, + { + "_content": "+LwWp37FYSj4r4DhN4Mv978s", + "available": false, + "extension": "jpeg", + "file_size": 18, + "id": "75be55cc5a6051d42b07a50dab7fd348" + }, + { + "_content": "LeJ8SqBSEoojRZn71vszQsc=", + "available": false, + "extension": "epub", + "file_size": 17, + "id": "3d4cd09285158e82dcdea6741857d49f" + }, + { + "_content": "b13ORCuLAOTVsnxVBWAg9g==", + "available": false, + "extension": "png", + "file_size": 16, + "id": "6271f9a794b77dae82d8f6213a783912" + }, + { + "_content": "Ew==", + "available": false, + "extension": "mp3", + "file_size": 1, + "id": "ffe51d3e7d8297237588704eeddc6ab2" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/411af6738f164071b150843b973c3bc1.json b/kolibri_explore_plugin/test/channels/411af6738f164071b150843b973c3bc1.json new file mode 100644 index 000000000..50869bf55 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/411af6738f164071b150843b973c3bc1.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "411af6738f164071b150843b973c3bc1", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "411af6738f164071b150843b973c3bc1", + "tagline": null, + "thumbnail": "data:image/jpg;base64,20a0dApCkCPiMa9w0J3iVzL3Z8Vjb1LmXk4lo4VN", + "version": 3 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "411af6738f164071b150843b973c3bc1", + "coach_content": false, + "content_id": "411af6738f164071b150843b973c3bc1", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "411af6738f164071b150843b973c3bc1", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "411af6738f164071b150843b973c3bc1", + "coach_content": false, + "content_id": "35b5e81aba1d4f82acb5b934c4e83064", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "bf8ced6d3b1b43c4a8fc66f56379655d", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "411af6738f164071b150843b973c3bc1", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "411af6738f164071b150843b973c3bc1", + "coach_content": false, + "content_id": "8314d8d9114c43a8a5463e16d16549bc", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "6e064cf41e564aafba7450eb529038ba", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "411af6738f164071b150843b973c3bc1", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "411af6738f164071b150843b973c3bc1", + "coach_content": false, + "content_id": "fb3e153c867645959b40e9590b463188", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "7777bbe724ca4c018c284d7e4d0bd79d", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "6e064cf41e564aafba7450eb529038ba", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "411af6738f164071b150843b973c3bc1", + "coach_content": false, + "content_id": "88c9604860394a13a8fbc045eefed8ae", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "e129938827094367a9868108f0818783", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "6e064cf41e564aafba7450eb529038ba", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "411af6738f164071b150843b973c3bc1", + "coach_content": false, + "content_id": "d44837b2ea0846b585d72dc0df5e5e17", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "c426ebdb581c4634a36ec0679a779047", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "6e064cf41e564aafba7450eb529038ba", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "bf8ced6d3b1b43c4a8fc66f56379655d", + "id": 1, + "to_contentnode_id": "411af6738f164071b150843b973c3bc1" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "bf8ced6d3b1b43c4a8fc66f56379655d", + "id": 1, + "to_contentnode_id": "6e064cf41e564aafba7450eb529038ba" + }, + { + "from_contentnode_id": "6e064cf41e564aafba7450eb529038ba", + "id": 2, + "to_contentnode_id": "bf8ced6d3b1b43c4a8fc66f56379655d" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "411af6738f164071b150843b973c3bc1", + "contenttag_id": "b4ac88aab1894fd4947977f89345f998", + "id": 1 + }, + { + "contentnode_id": "411af6738f164071b150843b973c3bc1", + "contenttag_id": "482342d58ef64cabb4f6d78b9de5c9c5", + "id": 2 + }, + { + "contentnode_id": "411af6738f164071b150843b973c3bc1", + "contenttag_id": "cc26c3d0dff3425488d44aa56c95b02c", + "id": 3 + }, + { + "contentnode_id": "bf8ced6d3b1b43c4a8fc66f56379655d", + "contenttag_id": "b4ac88aab1894fd4947977f89345f998", + "id": 4 + }, + { + "contentnode_id": "6e064cf41e564aafba7450eb529038ba", + "contenttag_id": "482342d58ef64cabb4f6d78b9de5c9c5", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "b4ac88aab1894fd4947977f89345f998", + "tag_name": "tag_1" + }, + { + "id": "482342d58ef64cabb4f6d78b9de5c9c5", + "tag_name": "tag_2" + }, + { + "id": "cc26c3d0dff3425488d44aa56c95b02c", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "bf8ced6d3b1b43c4a8fc66f56379655d", + "id": "079a0aa9037e43caae605dcd6cc815aa", + "lang_id": "en", + "local_file_id": "6752f99b900dacdffa60ad343ca27afb", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "bf8ced6d3b1b43c4a8fc66f56379655d", + "id": "46d65ddef4674b3da11c78638cce28ea", + "lang_id": "en", + "local_file_id": "a0a927b1ea5ba282f8450f1379985a9a", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "bf8ced6d3b1b43c4a8fc66f56379655d", + "id": "af2d9b1b70084f0a83f894ad5da1eff8", + "lang_id": null, + "local_file_id": "9d5ed678fe57bcca610140957afab571", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "bf8ced6d3b1b43c4a8fc66f56379655d", + "id": "16df78f03e094bbfb91c080f25cb67a0", + "lang_id": null, + "local_file_id": "f97dc5eb1cc4f75af557d56abdd10593", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "6e064cf41e564aafba7450eb529038ba", + "id": "1b614fd28d6f4282ae48ad49159f2e9c", + "lang_id": null, + "local_file_id": "b0a165f527dc1335f5ab08f7f2ebaae0", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "7777bbe724ca4c018c284d7e4d0bd79d", + "id": "6f914fd5235a4cefb8a42eaa782eabd6", + "lang_id": "3", + "local_file_id": "63ae65c2684b6782f27c2af2abd3f80d", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "7777bbe724ca4c018c284d7e4d0bd79d", + "id": "7e5e32850a92442b80c7fc7d76dea65d", + "lang_id": null, + "local_file_id": "df23d6bf77bcbe83d331c48fe10aab5a", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "e129938827094367a9868108f0818783", + "id": "ec90a65d04194d7a9cdb10cc66c0300e", + "lang_id": null, + "local_file_id": "9e38684ba4014a492e0efe3157de2d13", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "e129938827094367a9868108f0818783", + "id": "8ebdf939bd98476c85765eb4d94fa81a", + "lang_id": null, + "local_file_id": "1a9e2d46ab0cec21c7cf9f78a2191d9a", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "c426ebdb581c4634a36ec0679a779047", + "id": "8731f3ae14194c46ae4f2e587613e76b", + "lang_id": null, + "local_file_id": "aaea87f66c9f67b243aa09fae4e136e2", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "AJntug1KDAwBDVHIomL3rGcJGzk6lepmEqXemVdq", + "available": false, + "extension": "mp4", + "file_size": 30, + "id": "6752f99b900dacdffa60ad343ca27afb" + }, + { + "_content": "MHE+O/sqzlo=", + "available": false, + "extension": "mp4", + "file_size": 8, + "id": "a0a927b1ea5ba282f8450f1379985a9a" + }, + { + "_content": "Qg==", + "available": false, + "extension": "vtt", + "file_size": 1, + "id": "9d5ed678fe57bcca610140957afab571" + }, + { + "_content": "T+Ha7EmxASobUCcVHA==", + "available": false, + "extension": "png", + "file_size": 13, + "id": "f97dc5eb1cc4f75af557d56abdd10593" + }, + { + "_content": "+txX1hxjEPgXvK+h", + "available": false, + "extension": "jpeg", + "file_size": 12, + "id": "b0a165f527dc1335f5ab08f7f2ebaae0" + }, + { + "_content": "CTzh3A==", + "available": false, + "extension": "zip", + "file_size": 4, + "id": "63ae65c2684b6782f27c2af2abd3f80d" + }, + { + "_content": "ZxPbm/EsZ8nhw8uBX8qDN3O0KUnAWXg=", + "available": false, + "extension": "jpeg", + "file_size": 23, + "id": "df23d6bf77bcbe83d331c48fe10aab5a" + }, + { + "_content": "/8bQTK+z9OeQDUoUFF27BN4slV1XaePG+OxVtu8=", + "available": false, + "extension": "epub", + "file_size": 29, + "id": "9e38684ba4014a492e0efe3157de2d13" + }, + { + "_content": "RqaFUBNJEegEbpHo", + "available": false, + "extension": "png", + "file_size": 12, + "id": "1a9e2d46ab0cec21c7cf9f78a2191d9a" + }, + { + "_content": "9SbvUbpu1o2KAyeTdkYnSOJZfPFhKmmm", + "available": false, + "extension": "mp3", + "file_size": 24, + "id": "aaea87f66c9f67b243aa09fae4e136e2" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/4350f8ed80dd40dfbd4ed3c9732d449d.json b/kolibri_explore_plugin/test/channels/4350f8ed80dd40dfbd4ed3c9732d449d.json new file mode 100644 index 000000000..97caddb1e --- /dev/null +++ b/kolibri_explore_plugin/test/channels/4350f8ed80dd40dfbd4ed3c9732d449d.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "tagline": null, + "thumbnail": "data:image/jpg;base64,4G6k8z0l2OT46IDojVJMiUXwo1avlvEuYG+hbZ8f", + "version": 4 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "coach_content": false, + "content_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "coach_content": false, + "content_id": "ae15bda298604ee9b5d11c50a9c5b05c", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "e90d9e99c6d9485aace01ffe434f1009", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "coach_content": false, + "content_id": "ce543a9ad1d5425f82ad4b3be403c5b6", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "1739f8d267a3410a9f239fa91a93caa6", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "coach_content": false, + "content_id": "0662292afda74accb93ae7da54ee7487", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "da7039ae53174ca4a4cbc508310e046e", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "1739f8d267a3410a9f239fa91a93caa6", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "coach_content": false, + "content_id": "5ac62f679ae7461e8565d237964ca7b1", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "7db0f6eb5e084a8d8b8dbf823dda7de6", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "1739f8d267a3410a9f239fa91a93caa6", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "coach_content": false, + "content_id": "fe1ce4e971024cb89bdc093e156b8532", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "0f83f503f848402783c6805555236274", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "1739f8d267a3410a9f239fa91a93caa6", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "e90d9e99c6d9485aace01ffe434f1009", + "id": 1, + "to_contentnode_id": "4350f8ed80dd40dfbd4ed3c9732d449d" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "e90d9e99c6d9485aace01ffe434f1009", + "id": 1, + "to_contentnode_id": "1739f8d267a3410a9f239fa91a93caa6" + }, + { + "from_contentnode_id": "1739f8d267a3410a9f239fa91a93caa6", + "id": 2, + "to_contentnode_id": "e90d9e99c6d9485aace01ffe434f1009" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "contenttag_id": "3c8460332c2f43d5ab82db3985a0918b", + "id": 1 + }, + { + "contentnode_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "contenttag_id": "eeeb87ebffa74ac0961cdebcc259cfa8", + "id": 2 + }, + { + "contentnode_id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "contenttag_id": "8f5272bfb3414fb0b49977469f7f828b", + "id": 3 + }, + { + "contentnode_id": "e90d9e99c6d9485aace01ffe434f1009", + "contenttag_id": "3c8460332c2f43d5ab82db3985a0918b", + "id": 4 + }, + { + "contentnode_id": "1739f8d267a3410a9f239fa91a93caa6", + "contenttag_id": "eeeb87ebffa74ac0961cdebcc259cfa8", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "3c8460332c2f43d5ab82db3985a0918b", + "tag_name": "tag_1" + }, + { + "id": "eeeb87ebffa74ac0961cdebcc259cfa8", + "tag_name": "tag_2" + }, + { + "id": "8f5272bfb3414fb0b49977469f7f828b", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "e90d9e99c6d9485aace01ffe434f1009", + "id": "17ecfbd674ad46148c92ee1f5863acb2", + "lang_id": "en", + "local_file_id": "e4814ebbd75111a2f02bfa28a6af5db8", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "e90d9e99c6d9485aace01ffe434f1009", + "id": "f78ccdf9710147bc9805b0decebb83ed", + "lang_id": "en", + "local_file_id": "3e87f32cceaeb98c1de8ce6fab0eebb8", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "e90d9e99c6d9485aace01ffe434f1009", + "id": "e1211eea6c8a4525b284a3c744bea673", + "lang_id": null, + "local_file_id": "9e34101e6e7c50df7b9580a996df0229", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "e90d9e99c6d9485aace01ffe434f1009", + "id": "db01b93a02f243da84bb64f97e87c7b9", + "lang_id": null, + "local_file_id": "fedaab035adf14614dda0876270566b9", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "1739f8d267a3410a9f239fa91a93caa6", + "id": "1ba58fce61f24fd7b993217db5628e0f", + "lang_id": null, + "local_file_id": "d2840f2ef3707d90b7c6a71b90d40c63", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "da7039ae53174ca4a4cbc508310e046e", + "id": "3f6a16997c26416a91281c06af9ec19a", + "lang_id": "3", + "local_file_id": "1e3e1e9a4970b30ba0a3e9e17cfe4bf6", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "da7039ae53174ca4a4cbc508310e046e", + "id": "e57d4fdfdf294a56a00b269a445dbb1c", + "lang_id": null, + "local_file_id": "e358efa489f58062f10dd7316b65649e", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "7db0f6eb5e084a8d8b8dbf823dda7de6", + "id": "67e988ef9aa747e080f4e07cd38ded2d", + "lang_id": null, + "local_file_id": "fcec132d46cee2d401188c8267c3bacd", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "7db0f6eb5e084a8d8b8dbf823dda7de6", + "id": "f0ad7618a7eb4329828c9c8415ba0895", + "lang_id": null, + "local_file_id": "3de6a47620f01ad900018041f6dbd218", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "0f83f503f848402783c6805555236274", + "id": "5243d0ec307d43e5a52a06e2a92ce37c", + "lang_id": null, + "local_file_id": "cf0eece3a23b680f6266a21aabba4d32", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "h3QQ3kJGqeHe09k=", + "available": false, + "extension": "mp4", + "file_size": 11, + "id": "e4814ebbd75111a2f02bfa28a6af5db8" + }, + { + "_content": "2piM01eU", + "available": false, + "extension": "mp4", + "file_size": 6, + "id": "3e87f32cceaeb98c1de8ce6fab0eebb8" + }, + { + "_content": "7Kp2+Es=", + "available": false, + "extension": "vtt", + "file_size": 5, + "id": "9e34101e6e7c50df7b9580a996df0229" + }, + { + "_content": "r0G2M0MENCxzvLtU5S6doTdkyw==", + "available": false, + "extension": "png", + "file_size": 19, + "id": "fedaab035adf14614dda0876270566b9" + }, + { + "_content": "hhKT8G3CT/U=", + "available": false, + "extension": "jpeg", + "file_size": 8, + "id": "d2840f2ef3707d90b7c6a71b90d40c63" + }, + { + "_content": "N4lXjClwvopoMQIRQauJwwOV2hz4Gm589ehtwQ==", + "available": false, + "extension": "zip", + "file_size": 28, + "id": "1e3e1e9a4970b30ba0a3e9e17cfe4bf6" + }, + { + "_content": "dA==", + "available": false, + "extension": "jpeg", + "file_size": 1, + "id": "e358efa489f58062f10dd7316b65649e" + }, + { + "_content": "dPlYcJ4jx1Y=", + "available": false, + "extension": "epub", + "file_size": 8, + "id": "fcec132d46cee2d401188c8267c3bacd" + }, + { + "_content": "De5ovCgae8ESuI5FUAB0", + "available": false, + "extension": "png", + "file_size": 15, + "id": "3de6a47620f01ad900018041f6dbd218" + }, + { + "_content": "/A==", + "available": false, + "extension": "mp3", + "file_size": 1, + "id": "cf0eece3a23b680f6266a21aabba4d32" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/56048757b6644208a639fbdb03510ab8.json b/kolibri_explore_plugin/test/channels/56048757b6644208a639fbdb03510ab8.json new file mode 100644 index 000000000..c098075b2 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/56048757b6644208a639fbdb03510ab8.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "56048757b6644208a639fbdb03510ab8", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "56048757b6644208a639fbdb03510ab8", + "tagline": null, + "thumbnail": "data:image/jpg;base64,Q9DUtiZxHzh3i9GjZBNqGcZKAKN2oc3ZhXXJxF83", + "version": 3 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "56048757b6644208a639fbdb03510ab8", + "coach_content": false, + "content_id": "56048757b6644208a639fbdb03510ab8", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "56048757b6644208a639fbdb03510ab8", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "56048757b6644208a639fbdb03510ab8", + "coach_content": false, + "content_id": "6d61c40cfcc94e8aa553ee1b8bbd1778", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "5b45ba733da84be4b348bfa3e57cdbdc", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "56048757b6644208a639fbdb03510ab8", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "56048757b6644208a639fbdb03510ab8", + "coach_content": false, + "content_id": "bd1d086081f444b6b00c36ea6f837985", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "323005287ce84edfaf1cc154324b4618", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "56048757b6644208a639fbdb03510ab8", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "56048757b6644208a639fbdb03510ab8", + "coach_content": false, + "content_id": "80bc004a6bfd4a4dbb108a88cf1cef21", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "eeefb85a29c44a018fae0dae9357cb76", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "323005287ce84edfaf1cc154324b4618", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "56048757b6644208a639fbdb03510ab8", + "coach_content": false, + "content_id": "0883d0f29a08478cae3050d036f217fb", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "3d78511512c44097baeedc32d972e5eb", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "323005287ce84edfaf1cc154324b4618", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "56048757b6644208a639fbdb03510ab8", + "coach_content": false, + "content_id": "0c1f79a4a19e4ca0b1fdf26298892d35", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "436f8174a1b14316bdc08a02d18b5cc7", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "323005287ce84edfaf1cc154324b4618", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "5b45ba733da84be4b348bfa3e57cdbdc", + "id": 1, + "to_contentnode_id": "56048757b6644208a639fbdb03510ab8" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "5b45ba733da84be4b348bfa3e57cdbdc", + "id": 1, + "to_contentnode_id": "323005287ce84edfaf1cc154324b4618" + }, + { + "from_contentnode_id": "323005287ce84edfaf1cc154324b4618", + "id": 2, + "to_contentnode_id": "5b45ba733da84be4b348bfa3e57cdbdc" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "56048757b6644208a639fbdb03510ab8", + "contenttag_id": "17c627d6512143de84d9fc4d8acf917b", + "id": 1 + }, + { + "contentnode_id": "56048757b6644208a639fbdb03510ab8", + "contenttag_id": "22d3e9e2bf9044968ed1151cb2beaa0a", + "id": 2 + }, + { + "contentnode_id": "56048757b6644208a639fbdb03510ab8", + "contenttag_id": "93de1955d0e940bca7a2579269106465", + "id": 3 + }, + { + "contentnode_id": "5b45ba733da84be4b348bfa3e57cdbdc", + "contenttag_id": "17c627d6512143de84d9fc4d8acf917b", + "id": 4 + }, + { + "contentnode_id": "323005287ce84edfaf1cc154324b4618", + "contenttag_id": "22d3e9e2bf9044968ed1151cb2beaa0a", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "17c627d6512143de84d9fc4d8acf917b", + "tag_name": "tag_1" + }, + { + "id": "22d3e9e2bf9044968ed1151cb2beaa0a", + "tag_name": "tag_2" + }, + { + "id": "93de1955d0e940bca7a2579269106465", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "5b45ba733da84be4b348bfa3e57cdbdc", + "id": "8039a7d9abce4aa6ab373fd7ac76aebf", + "lang_id": "en", + "local_file_id": "2b168e900bf580a6da3daaa6675717f4", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "5b45ba733da84be4b348bfa3e57cdbdc", + "id": "d4ab6c9606b44d9fa5809fdf104a0cd8", + "lang_id": "en", + "local_file_id": "3784dcff0072350fe4a7969b15e5a451", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "5b45ba733da84be4b348bfa3e57cdbdc", + "id": "4067a15e4073466fb149649fb592c1ea", + "lang_id": null, + "local_file_id": "2a4c8e513811538e5e7e916d73884eef", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "5b45ba733da84be4b348bfa3e57cdbdc", + "id": "9df9b0c7cc4c4694a05ba3328af057bb", + "lang_id": null, + "local_file_id": "3b60a17d1deb6e90f09ca8780ed85685", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "323005287ce84edfaf1cc154324b4618", + "id": "10fdde8f672e43b98ef4d4e373371781", + "lang_id": null, + "local_file_id": "64e81b44360702c3fe7240ad33957fad", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "eeefb85a29c44a018fae0dae9357cb76", + "id": "2f733e98894a4b30979d3cf2f4886094", + "lang_id": "3", + "local_file_id": "42b1b90f4dec33e28efa9b3abe470cc9", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "eeefb85a29c44a018fae0dae9357cb76", + "id": "3ad2f9f796584687ad41e40fa77aa74e", + "lang_id": null, + "local_file_id": "769c92992942b74b9044a1e1d9398410", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "3d78511512c44097baeedc32d972e5eb", + "id": "bc3725cad7d54c599175ccaeb2d77bdb", + "lang_id": null, + "local_file_id": "485e35be32f0b366fc3528907884c4c9", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "3d78511512c44097baeedc32d972e5eb", + "id": "957cd07711c94ce0811409e0e772bb36", + "lang_id": null, + "local_file_id": "00d9712ec5eb70807a73b8d2d6ead90d", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "436f8174a1b14316bdc08a02d18b5cc7", + "id": "5ad6e4458f49473f9cf66c1177e76d5c", + "lang_id": null, + "local_file_id": "9831275e8ea2516c4a139ba30acdccf6", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "9DOjqY4DI/8=", + "available": false, + "extension": "mp4", + "file_size": 8, + "id": "2b168e900bf580a6da3daaa6675717f4" + }, + { + "_content": "8inIfaXDf+b8", + "available": false, + "extension": "mp4", + "file_size": 9, + "id": "3784dcff0072350fe4a7969b15e5a451" + }, + { + "_content": "mpo7dJHODx0uJ/rrkly81ZnuY4CzUNhqinFn", + "available": false, + "extension": "vtt", + "file_size": 27, + "id": "2a4c8e513811538e5e7e916d73884eef" + }, + { + "_content": "mrzRaa0JaJNEH4jJ7B5glKsJwAltfB2qRQ==", + "available": false, + "extension": "png", + "file_size": 25, + "id": "3b60a17d1deb6e90f09ca8780ed85685" + }, + { + "_content": "k8NmgAPCRFcjfAUMJrhNe8IxEA==", + "available": false, + "extension": "jpeg", + "file_size": 19, + "id": "64e81b44360702c3fe7240ad33957fad" + }, + { + "_content": "WnauBQyHamoqX1bQGB094y78kJmC40EXyhw2FIOi", + "available": false, + "extension": "zip", + "file_size": 30, + "id": "42b1b90f4dec33e28efa9b3abe470cc9" + }, + { + "_content": "/s8kwQuHfDqcGNyV8ASJ6KatiA==", + "available": false, + "extension": "jpeg", + "file_size": 19, + "id": "769c92992942b74b9044a1e1d9398410" + }, + { + "_content": "u2CpU2zrMis=", + "available": false, + "extension": "epub", + "file_size": 8, + "id": "485e35be32f0b366fc3528907884c4c9" + }, + { + "_content": "rw==", + "available": false, + "extension": "png", + "file_size": 1, + "id": "00d9712ec5eb70807a73b8d2d6ead90d" + }, + { + "_content": "RWLfu1z6SqQoEue7t0bEjbvJPyUVnD8k0g==", + "available": false, + "extension": "mp3", + "file_size": 25, + "id": "9831275e8ea2516c4a139ba30acdccf6" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/5e7db57c21df4230bad6e8b365754632.json b/kolibri_explore_plugin/test/channels/5e7db57c21df4230bad6e8b365754632.json new file mode 100644 index 000000000..34a5ec5a4 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/5e7db57c21df4230bad6e8b365754632.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "5e7db57c21df4230bad6e8b365754632", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "5e7db57c21df4230bad6e8b365754632", + "tagline": null, + "thumbnail": "data:image/jpg;base64,8BZmYFE0uIHBY6CS3+QPjamVc670F1PEzcswh4tT", + "version": 4 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "5e7db57c21df4230bad6e8b365754632", + "coach_content": false, + "content_id": "5e7db57c21df4230bad6e8b365754632", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "5e7db57c21df4230bad6e8b365754632", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "5e7db57c21df4230bad6e8b365754632", + "coach_content": false, + "content_id": "0178aa6ce566483e918c10a61512c7bc", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "20945f2430894c1baf64aa02dbf9775c", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "5e7db57c21df4230bad6e8b365754632", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "5e7db57c21df4230bad6e8b365754632", + "coach_content": false, + "content_id": "5400cc4e4268418781c33a23ad522a1d", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "a6fff781180445f696c92e757dfbfc9c", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "5e7db57c21df4230bad6e8b365754632", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "5e7db57c21df4230bad6e8b365754632", + "coach_content": false, + "content_id": "d9121da72b83430a99224098733b8681", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "d69f8e8e6f0442cd97538a981d877877", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "a6fff781180445f696c92e757dfbfc9c", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "5e7db57c21df4230bad6e8b365754632", + "coach_content": false, + "content_id": "db0247bcac8a41e284f59fbc49205dee", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "2ebc745323324cfaad91674b42f96ee3", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "a6fff781180445f696c92e757dfbfc9c", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "5e7db57c21df4230bad6e8b365754632", + "coach_content": false, + "content_id": "3ddb62a5bcf44985a4b7c0d50792136f", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "befca53981d74a9bba75a371ae52c0d9", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "a6fff781180445f696c92e757dfbfc9c", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "20945f2430894c1baf64aa02dbf9775c", + "id": 1, + "to_contentnode_id": "5e7db57c21df4230bad6e8b365754632" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "20945f2430894c1baf64aa02dbf9775c", + "id": 1, + "to_contentnode_id": "a6fff781180445f696c92e757dfbfc9c" + }, + { + "from_contentnode_id": "a6fff781180445f696c92e757dfbfc9c", + "id": 2, + "to_contentnode_id": "20945f2430894c1baf64aa02dbf9775c" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "5e7db57c21df4230bad6e8b365754632", + "contenttag_id": "a02eae88df2142568c7a90547296e1fa", + "id": 1 + }, + { + "contentnode_id": "5e7db57c21df4230bad6e8b365754632", + "contenttag_id": "a1518b0c254444199f958880193cad0b", + "id": 2 + }, + { + "contentnode_id": "5e7db57c21df4230bad6e8b365754632", + "contenttag_id": "48ba9a5b27ab4e6dae9233114e8d73c2", + "id": 3 + }, + { + "contentnode_id": "20945f2430894c1baf64aa02dbf9775c", + "contenttag_id": "a02eae88df2142568c7a90547296e1fa", + "id": 4 + }, + { + "contentnode_id": "a6fff781180445f696c92e757dfbfc9c", + "contenttag_id": "a1518b0c254444199f958880193cad0b", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "a02eae88df2142568c7a90547296e1fa", + "tag_name": "tag_1" + }, + { + "id": "a1518b0c254444199f958880193cad0b", + "tag_name": "tag_2" + }, + { + "id": "48ba9a5b27ab4e6dae9233114e8d73c2", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "20945f2430894c1baf64aa02dbf9775c", + "id": "6afbaf475d1a480d97159cee0a8aecc8", + "lang_id": "en", + "local_file_id": "4df94301939486700e5f48de6dd9f337", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "20945f2430894c1baf64aa02dbf9775c", + "id": "eb7e85a10a8842138f51c672ffc4cf05", + "lang_id": "en", + "local_file_id": "8a0233de8d3fda8822cdfa44a6e528db", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "20945f2430894c1baf64aa02dbf9775c", + "id": "de51542bf5b447edb378d339b3667f01", + "lang_id": null, + "local_file_id": "17470780cb91aa42d00d936b6a282ba0", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "20945f2430894c1baf64aa02dbf9775c", + "id": "56c68e55b7ad4f0c977942f69493ad1b", + "lang_id": null, + "local_file_id": "04aba59f36b53c6ad368d2597a5005f6", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "a6fff781180445f696c92e757dfbfc9c", + "id": "8762dbae862541edb8e8b35a47fe5deb", + "lang_id": null, + "local_file_id": "e5e7237f535a82e767e5cf0ab84524d9", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "d69f8e8e6f0442cd97538a981d877877", + "id": "35df28168cba457691c7b3a7fc37e701", + "lang_id": "3", + "local_file_id": "af113d2947909c1c7e309a51713a2ecc", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "d69f8e8e6f0442cd97538a981d877877", + "id": "16476556c0644b8bb1e07336743b4f0f", + "lang_id": null, + "local_file_id": "154accc15c5c3416d8d33395443ec49b", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "2ebc745323324cfaad91674b42f96ee3", + "id": "8c7ae6f09ceb479e81aa8fcb12d393cd", + "lang_id": null, + "local_file_id": "47a017141b2402fb9af711728699f5c5", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "2ebc745323324cfaad91674b42f96ee3", + "id": "d179dad51d45423d842c5ee15181daa1", + "lang_id": null, + "local_file_id": "dc3a7c9c5a0d1c6413b0a933812ca18d", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "befca53981d74a9bba75a371ae52c0d9", + "id": "4de720c34f674903b90a31adf7dd1118", + "lang_id": null, + "local_file_id": "1639f0e590d9e02606b9a7086b1d5f50", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "TyYVK/R9w3RZfc+n92yePv8Q4aF48zlKQuUGXQ==", + "available": false, + "extension": "mp4", + "file_size": 28, + "id": "4df94301939486700e5f48de6dd9f337" + }, + { + "_content": "j53wd7SqhyXGlvWBIMerDLSm3zqZD0Cz", + "available": false, + "extension": "mp4", + "file_size": 24, + "id": "8a0233de8d3fda8822cdfa44a6e528db" + }, + { + "_content": "rot9ibkVyYLnYQ1ScQUhZyMlroH+iP5Aha3zGw==", + "available": false, + "extension": "vtt", + "file_size": 28, + "id": "17470780cb91aa42d00d936b6a282ba0" + }, + { + "_content": "7ufElViIMax2SG9UA2SOzlv9yxQX/N8=", + "available": false, + "extension": "png", + "file_size": 23, + "id": "04aba59f36b53c6ad368d2597a5005f6" + }, + { + "_content": "DURtTAP/pfJFRtthrchu", + "available": false, + "extension": "jpeg", + "file_size": 15, + "id": "e5e7237f535a82e767e5cf0ab84524d9" + }, + { + "_content": "E9KA/Ysllrp+lPXM3MNymiys", + "available": false, + "extension": "zip", + "file_size": 18, + "id": "af113d2947909c1c7e309a51713a2ecc" + }, + { + "_content": "sawqRev8MN80MmP9pRdgoCeaYAvGCQ==", + "available": false, + "extension": "jpeg", + "file_size": 22, + "id": "154accc15c5c3416d8d33395443ec49b" + }, + { + "_content": "xLWRPyc=", + "available": false, + "extension": "epub", + "file_size": 5, + "id": "47a017141b2402fb9af711728699f5c5" + }, + { + "_content": "W6PBz9FV+DN8NGdOYf+u+6o=", + "available": false, + "extension": "png", + "file_size": 17, + "id": "dc3a7c9c5a0d1c6413b0a933812ca18d" + }, + { + "_content": "awYqvJH2fV2QIEKsnZYmd+NH", + "available": false, + "extension": "mp3", + "file_size": 18, + "id": "1639f0e590d9e02606b9a7086b1d5f50" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/64fa38415b4849629d027069b4110bab.json b/kolibri_explore_plugin/test/channels/64fa38415b4849629d027069b4110bab.json new file mode 100644 index 000000000..5379f7dab --- /dev/null +++ b/kolibri_explore_plugin/test/channels/64fa38415b4849629d027069b4110bab.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "64fa38415b4849629d027069b4110bab", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "64fa38415b4849629d027069b4110bab", + "tagline": null, + "thumbnail": "data:image/jpg;base64,/G/wr3Jzppz4bTN0LEkYrZuQWtSCw6EFjonLrvgd", + "version": 2 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "64fa38415b4849629d027069b4110bab", + "coach_content": false, + "content_id": "64fa38415b4849629d027069b4110bab", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "64fa38415b4849629d027069b4110bab", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "64fa38415b4849629d027069b4110bab", + "coach_content": false, + "content_id": "6a5c8bdd277e4892b11340f57e3fafd6", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "9ec8e38f7eed4744af532c3757a742d3", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "64fa38415b4849629d027069b4110bab", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "64fa38415b4849629d027069b4110bab", + "coach_content": false, + "content_id": "975203832f664110a5d435a9f29c49bf", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "b5d170ed9d1045dda67ca3d49b56fb8e", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "64fa38415b4849629d027069b4110bab", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "64fa38415b4849629d027069b4110bab", + "coach_content": false, + "content_id": "b9a31e35890246f0b2aa3d88431cd4df", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "963463f55f6341049fb04b4769bca349", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "b5d170ed9d1045dda67ca3d49b56fb8e", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "64fa38415b4849629d027069b4110bab", + "coach_content": false, + "content_id": "670dc708b83147e69ebbb2e0cb109833", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "d077718ec620479fbd320d4b06b76658", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "b5d170ed9d1045dda67ca3d49b56fb8e", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "64fa38415b4849629d027069b4110bab", + "coach_content": false, + "content_id": "4da5e6b9125b4fcdacb436cceaba48ee", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "b5580a4d1b524eeb8e3cd6e47dd52235", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "b5d170ed9d1045dda67ca3d49b56fb8e", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "9ec8e38f7eed4744af532c3757a742d3", + "id": 1, + "to_contentnode_id": "64fa38415b4849629d027069b4110bab" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "9ec8e38f7eed4744af532c3757a742d3", + "id": 1, + "to_contentnode_id": "b5d170ed9d1045dda67ca3d49b56fb8e" + }, + { + "from_contentnode_id": "b5d170ed9d1045dda67ca3d49b56fb8e", + "id": 2, + "to_contentnode_id": "9ec8e38f7eed4744af532c3757a742d3" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "64fa38415b4849629d027069b4110bab", + "contenttag_id": "c5f9c26ca0ac4832bed90d35412b6573", + "id": 1 + }, + { + "contentnode_id": "64fa38415b4849629d027069b4110bab", + "contenttag_id": "b067e5643b594d40bbe9b3fbb26fffe5", + "id": 2 + }, + { + "contentnode_id": "64fa38415b4849629d027069b4110bab", + "contenttag_id": "79ddbfe9ff194bc3a7ea17a4ccf9f945", + "id": 3 + }, + { + "contentnode_id": "9ec8e38f7eed4744af532c3757a742d3", + "contenttag_id": "c5f9c26ca0ac4832bed90d35412b6573", + "id": 4 + }, + { + "contentnode_id": "b5d170ed9d1045dda67ca3d49b56fb8e", + "contenttag_id": "b067e5643b594d40bbe9b3fbb26fffe5", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "c5f9c26ca0ac4832bed90d35412b6573", + "tag_name": "tag_1" + }, + { + "id": "b067e5643b594d40bbe9b3fbb26fffe5", + "tag_name": "tag_2" + }, + { + "id": "79ddbfe9ff194bc3a7ea17a4ccf9f945", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "9ec8e38f7eed4744af532c3757a742d3", + "id": "e3c56e1197bb4037b72f9844ecf1097f", + "lang_id": "en", + "local_file_id": "042349214fc0a04dbf03ee84ee041b14", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "9ec8e38f7eed4744af532c3757a742d3", + "id": "991d5f99e13e4e4f9c15a77915cd9806", + "lang_id": "en", + "local_file_id": "6d867878693f2b286bf59d196eacdebf", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "9ec8e38f7eed4744af532c3757a742d3", + "id": "42ff60b4167146ee8b7ba8f838010fcb", + "lang_id": null, + "local_file_id": "21add903f1cd55a74396d43c3e4c87bd", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "9ec8e38f7eed4744af532c3757a742d3", + "id": "04de97a89f414f8ca18423a2ad4f0cb8", + "lang_id": null, + "local_file_id": "1c229cffc816accc1dbcbd39a1f2885e", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "b5d170ed9d1045dda67ca3d49b56fb8e", + "id": "ca6c56ec72fa4fe0a107d58300cd178b", + "lang_id": null, + "local_file_id": "01bbd81286f7aeab0276ff4883b951e0", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "963463f55f6341049fb04b4769bca349", + "id": "eca6d72aad544185aa2f0ce8eaf219bb", + "lang_id": "3", + "local_file_id": "c9251f117018b9694d94b1602f125581", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "963463f55f6341049fb04b4769bca349", + "id": "470c18f3c7224d41befac4aa562bb797", + "lang_id": null, + "local_file_id": "4209e447d8462f151271ec512ae00d07", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "d077718ec620479fbd320d4b06b76658", + "id": "fd895e57ca1049d8bee6b5c6d3e95e10", + "lang_id": null, + "local_file_id": "65ce16acbc46826486fb80d73debe52c", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "d077718ec620479fbd320d4b06b76658", + "id": "cae06006f5a84e6aa74793ef1c7761d7", + "lang_id": null, + "local_file_id": "3dc0f12d72e76f997fbb447303d0817c", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "b5580a4d1b524eeb8e3cd6e47dd52235", + "id": "725018271bb64de7a4dcf279cdf0ee29", + "lang_id": null, + "local_file_id": "898846e7a3a82d306bf520c22514afad", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "IVf4ydbc", + "available": false, + "extension": "mp4", + "file_size": 6, + "id": "042349214fc0a04dbf03ee84ee041b14" + }, + { + "_content": "UaZ74Ui1ZWGWo85bnktKLptPnsjyXN8E", + "available": false, + "extension": "mp4", + "file_size": 24, + "id": "6d867878693f2b286bf59d196eacdebf" + }, + { + "_content": "LvkkMspq", + "available": false, + "extension": "vtt", + "file_size": 6, + "id": "21add903f1cd55a74396d43c3e4c87bd" + }, + { + "_content": "PtqcPzPuui1l23X5zKczAq0WzGmrehz7NibD3Ro=", + "available": false, + "extension": "png", + "file_size": 29, + "id": "1c229cffc816accc1dbcbd39a1f2885e" + }, + { + "_content": "eO4U", + "available": false, + "extension": "jpeg", + "file_size": 3, + "id": "01bbd81286f7aeab0276ff4883b951e0" + }, + { + "_content": "uzH8IIH5svvhUDnRb8HpG2lBxz1EJA==", + "available": false, + "extension": "zip", + "file_size": 22, + "id": "c9251f117018b9694d94b1602f125581" + }, + { + "_content": "SwoErULWz3I=", + "available": false, + "extension": "jpeg", + "file_size": 8, + "id": "4209e447d8462f151271ec512ae00d07" + }, + { + "_content": "9oh0SUNJ", + "available": false, + "extension": "epub", + "file_size": 6, + "id": "65ce16acbc46826486fb80d73debe52c" + }, + { + "_content": "r+nt/5AUUuv0xNKFqxBiG0adL2Z8ETmO", + "available": false, + "extension": "png", + "file_size": 24, + "id": "3dc0f12d72e76f997fbb447303d0817c" + }, + { + "_content": "WunzPoOad/ikRQ==", + "available": false, + "extension": "mp3", + "file_size": 10, + "id": "898846e7a3a82d306bf520c22514afad" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/65a2964ce74943778bdabb348caebb0d.json b/kolibri_explore_plugin/test/channels/65a2964ce74943778bdabb348caebb0d.json new file mode 100644 index 000000000..c9c78c930 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/65a2964ce74943778bdabb348caebb0d.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "65a2964ce74943778bdabb348caebb0d", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "65a2964ce74943778bdabb348caebb0d", + "tagline": null, + "thumbnail": "data:image/jpg;base64,pxZAjicoOiuF0JniclYty1E0HMrhl6t/zKSDlPMQ", + "version": 4 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "65a2964ce74943778bdabb348caebb0d", + "coach_content": false, + "content_id": "65a2964ce74943778bdabb348caebb0d", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "65a2964ce74943778bdabb348caebb0d", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "65a2964ce74943778bdabb348caebb0d", + "coach_content": false, + "content_id": "8b121436b2144ebfa803be9f7a787ea4", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "48b2b950bdc747ceb6fe60ecd8436c91", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "65a2964ce74943778bdabb348caebb0d", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "65a2964ce74943778bdabb348caebb0d", + "coach_content": false, + "content_id": "163f8c6836174107859fc861d3bbe64d", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "5b214ecbe90145b4b5ed120d88298bb2", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "65a2964ce74943778bdabb348caebb0d", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "65a2964ce74943778bdabb348caebb0d", + "coach_content": false, + "content_id": "30eaa588c38c431aa749efe9c622da6c", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "bbed2c6fef944970b8108584e39d5fd7", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "5b214ecbe90145b4b5ed120d88298bb2", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "65a2964ce74943778bdabb348caebb0d", + "coach_content": false, + "content_id": "8d1fd642bcf6446d8c705a0bebdd8c85", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "b828889127344e9fba277dc6b3b89ae4", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "5b214ecbe90145b4b5ed120d88298bb2", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "65a2964ce74943778bdabb348caebb0d", + "coach_content": false, + "content_id": "2c55203e0bf040cdbbf2b0deec7cf321", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "a82e29dfe69e4b8fbb1a15d5c5ebf369", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "5b214ecbe90145b4b5ed120d88298bb2", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "48b2b950bdc747ceb6fe60ecd8436c91", + "id": 1, + "to_contentnode_id": "65a2964ce74943778bdabb348caebb0d" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "48b2b950bdc747ceb6fe60ecd8436c91", + "id": 1, + "to_contentnode_id": "5b214ecbe90145b4b5ed120d88298bb2" + }, + { + "from_contentnode_id": "5b214ecbe90145b4b5ed120d88298bb2", + "id": 2, + "to_contentnode_id": "48b2b950bdc747ceb6fe60ecd8436c91" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "65a2964ce74943778bdabb348caebb0d", + "contenttag_id": "80c35dfbf8a142979e1958115bfc1104", + "id": 1 + }, + { + "contentnode_id": "65a2964ce74943778bdabb348caebb0d", + "contenttag_id": "d3f299eae62e4d10a58b9dd38988ad2b", + "id": 2 + }, + { + "contentnode_id": "65a2964ce74943778bdabb348caebb0d", + "contenttag_id": "0fe56ee05181403199251a00199dc260", + "id": 3 + }, + { + "contentnode_id": "48b2b950bdc747ceb6fe60ecd8436c91", + "contenttag_id": "80c35dfbf8a142979e1958115bfc1104", + "id": 4 + }, + { + "contentnode_id": "5b214ecbe90145b4b5ed120d88298bb2", + "contenttag_id": "d3f299eae62e4d10a58b9dd38988ad2b", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "80c35dfbf8a142979e1958115bfc1104", + "tag_name": "tag_1" + }, + { + "id": "d3f299eae62e4d10a58b9dd38988ad2b", + "tag_name": "tag_2" + }, + { + "id": "0fe56ee05181403199251a00199dc260", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "48b2b950bdc747ceb6fe60ecd8436c91", + "id": "72fc2a2e0ee24fb4bce69adfd532d0bf", + "lang_id": "en", + "local_file_id": "ad86175540709c3b60680f652b069af6", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "48b2b950bdc747ceb6fe60ecd8436c91", + "id": "6665c65294af4683a5ff10ece0c70a84", + "lang_id": "en", + "local_file_id": "75059df942bfdfb27e9b574d601773f9", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "48b2b950bdc747ceb6fe60ecd8436c91", + "id": "4562df66ef6441088dab88ba51c5e06c", + "lang_id": null, + "local_file_id": "41cedc0fdad93c0986021134ef5b4a48", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "48b2b950bdc747ceb6fe60ecd8436c91", + "id": "8a98a9fb4e5545a78f67e24124596b07", + "lang_id": null, + "local_file_id": "ee05d74ef123350f8d2bb6c31ef4a927", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "5b214ecbe90145b4b5ed120d88298bb2", + "id": "631f1d39f1044c538b2fbbd3587f4647", + "lang_id": null, + "local_file_id": "8c47201ce154dd1565234e5b6e11c259", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "bbed2c6fef944970b8108584e39d5fd7", + "id": "286a0ca37cc54ac2a055ff63882d7151", + "lang_id": "3", + "local_file_id": "af8d03335b91ae7ae888cb9a5bde45b5", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "bbed2c6fef944970b8108584e39d5fd7", + "id": "1a5dfd7be3fd431ebd9f81fc359bc2a6", + "lang_id": null, + "local_file_id": "35606a426ace3fae1fbb0d6443f65a47", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "b828889127344e9fba277dc6b3b89ae4", + "id": "4855bfc400ca426183f50e5c1b84425a", + "lang_id": null, + "local_file_id": "d3e301c70141c6ce80013b1eaf4ede9c", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "b828889127344e9fba277dc6b3b89ae4", + "id": "0d87ad71c8584257a613b9bb9203343b", + "lang_id": null, + "local_file_id": "5ea73892545168e4aa44b292198e3f2e", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "a82e29dfe69e4b8fbb1a15d5c5ebf369", + "id": "944e2cf883f64bc3b161bc6cd2e01f47", + "lang_id": null, + "local_file_id": "b3f97c76ecac1ba721170523444060a9", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "BTtIjd5P4D6ZgVeSleNTqvE=", + "available": false, + "extension": "mp4", + "file_size": 17, + "id": "ad86175540709c3b60680f652b069af6" + }, + { + "_content": "454UtQnGnq4Pm/yyA9NgUxxSt7n0Mw==", + "available": false, + "extension": "mp4", + "file_size": 22, + "id": "75059df942bfdfb27e9b574d601773f9" + }, + { + "_content": "6O5UQfH4ue0=", + "available": false, + "extension": "vtt", + "file_size": 8, + "id": "41cedc0fdad93c0986021134ef5b4a48" + }, + { + "_content": "IiNE2xDXb9GsGdLx9DkM5U5OMUeLJ6GHHDY4ZOoH", + "available": false, + "extension": "png", + "file_size": 30, + "id": "ee05d74ef123350f8d2bb6c31ef4a927" + }, + { + "_content": "tGarsir9GFSXvi/Pnt1A2rWejA1RgQ==", + "available": false, + "extension": "jpeg", + "file_size": 22, + "id": "8c47201ce154dd1565234e5b6e11c259" + }, + { + "_content": "tJHYz+QKlnZx1u86Ki0eCf7a9JHut7WHhQ==", + "available": false, + "extension": "zip", + "file_size": 25, + "id": "af8d03335b91ae7ae888cb9a5bde45b5" + }, + { + "_content": "YLQmzR8Sl2U0mAATRQ0yAkiJlKGzgZ5FTZP5Ruw=", + "available": false, + "extension": "jpeg", + "file_size": 29, + "id": "35606a426ace3fae1fbb0d6443f65a47" + }, + { + "_content": "cEaEbA==", + "available": false, + "extension": "epub", + "file_size": 4, + "id": "d3e301c70141c6ce80013b1eaf4ede9c" + }, + { + "_content": "RjBM9zMzfhl6oqbnuI5FzFs9dR6y2+rSBA6Mmw==", + "available": false, + "extension": "png", + "file_size": 28, + "id": "5ea73892545168e4aa44b292198e3f2e" + }, + { + "_content": "jU9lyNbeLBat+HepzvhvJhU=", + "available": false, + "extension": "mp3", + "file_size": 17, + "id": "b3f97c76ecac1ba721170523444060a9" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/6aba580c1c7b41ebaac64e5ef7b1cb08.json b/kolibri_explore_plugin/test/channels/6aba580c1c7b41ebaac64e5ef7b1cb08.json new file mode 100644 index 000000000..2b1f5e72d --- /dev/null +++ b/kolibri_explore_plugin/test/channels/6aba580c1c7b41ebaac64e5ef7b1cb08.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "tagline": null, + "thumbnail": "data:image/jpg;base64,aGvLbSvcKrNCBh12/yM9OilsQmO3jocItRrZheZC", + "version": 1 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "coach_content": false, + "content_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "coach_content": false, + "content_id": "12fd6b53717a4dd3a884baee6ff11399", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "e73c0cba43a945f7a79b55d467e3fbef", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "coach_content": false, + "content_id": "84f9ba878efc4e628e2216e682ebb888", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "199e6fab30144413bc28d68fee737eda", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "coach_content": false, + "content_id": "9ade04cfc972461daaa5ca16a7b22425", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "cb43cfcdbe1a439f824dc7f0552294c1", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "199e6fab30144413bc28d68fee737eda", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "coach_content": false, + "content_id": "b7c0f3e4cd9540db89c5bc2127ab2a51", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "196dcbd78fa34a468e1b7c7416ee0242", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "199e6fab30144413bc28d68fee737eda", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "coach_content": false, + "content_id": "55bc7402ede34ac88a11f1221528af05", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "e19cb95d65b74e63a6eec39dc012a819", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "199e6fab30144413bc28d68fee737eda", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "e73c0cba43a945f7a79b55d467e3fbef", + "id": 1, + "to_contentnode_id": "6aba580c1c7b41ebaac64e5ef7b1cb08" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "e73c0cba43a945f7a79b55d467e3fbef", + "id": 1, + "to_contentnode_id": "199e6fab30144413bc28d68fee737eda" + }, + { + "from_contentnode_id": "199e6fab30144413bc28d68fee737eda", + "id": 2, + "to_contentnode_id": "e73c0cba43a945f7a79b55d467e3fbef" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "contenttag_id": "6dc162dfc87b4e4a8d0cf0dab73f10e9", + "id": 1 + }, + { + "contentnode_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "contenttag_id": "ecda3a7f6ddd4f56a4425ce7f86ee98c", + "id": 2 + }, + { + "contentnode_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "contenttag_id": "40557dcdfdae4c518096c119b975574e", + "id": 3 + }, + { + "contentnode_id": "e73c0cba43a945f7a79b55d467e3fbef", + "contenttag_id": "6dc162dfc87b4e4a8d0cf0dab73f10e9", + "id": 4 + }, + { + "contentnode_id": "199e6fab30144413bc28d68fee737eda", + "contenttag_id": "ecda3a7f6ddd4f56a4425ce7f86ee98c", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "6dc162dfc87b4e4a8d0cf0dab73f10e9", + "tag_name": "tag_1" + }, + { + "id": "ecda3a7f6ddd4f56a4425ce7f86ee98c", + "tag_name": "tag_2" + }, + { + "id": "40557dcdfdae4c518096c119b975574e", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "e73c0cba43a945f7a79b55d467e3fbef", + "id": "d6aa547a797f4e9ead3fcbfd5ebd2284", + "lang_id": "en", + "local_file_id": "aafa9631e6bbc84dc09c932e8c82b2cb", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "e73c0cba43a945f7a79b55d467e3fbef", + "id": "8b86c0b61e9b44c4a657a6be9e1a4cbb", + "lang_id": "en", + "local_file_id": "0fde13127102b53ffea38972bfa95043", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "e73c0cba43a945f7a79b55d467e3fbef", + "id": "ddbc4d21888a43a0a1e96db9af993f64", + "lang_id": null, + "local_file_id": "9e2eb65ed17406ada4560db84996543d", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "e73c0cba43a945f7a79b55d467e3fbef", + "id": "5e060b1eae914c228ca7c7150e2511f9", + "lang_id": null, + "local_file_id": "13d7bbfd951422a82f5ac9d52edc6f29", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "199e6fab30144413bc28d68fee737eda", + "id": "8528dbc980034d4b9980a68dc29020a4", + "lang_id": null, + "local_file_id": "ad65c8a19b842a7cbff69c1d1928c0f1", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "cb43cfcdbe1a439f824dc7f0552294c1", + "id": "340941adf8b14fc6ae9cc8ee26359080", + "lang_id": "3", + "local_file_id": "16f88b1efa6d0c668648cfb4c6dd68ce", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "cb43cfcdbe1a439f824dc7f0552294c1", + "id": "49a6ba9fda30455494a3a29e17011cda", + "lang_id": null, + "local_file_id": "2059ca40f0490ba62b32cdf39d0d351d", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "196dcbd78fa34a468e1b7c7416ee0242", + "id": "acb7813f8ffc45d0b37aef23ae8a1f2f", + "lang_id": null, + "local_file_id": "101cff6e0ff355085294d891e5a33011", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "196dcbd78fa34a468e1b7c7416ee0242", + "id": "7dae760b9d5b4b97bbe0daba9dca9e6b", + "lang_id": null, + "local_file_id": "b1f82e3d35c86ccb20882ab5f1c2321c", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "e19cb95d65b74e63a6eec39dc012a819", + "id": "b05f7486ad994d69bb9bc2129489a6a1", + "lang_id": null, + "local_file_id": "d61658cf80ebc8079fd97dabac1b4cd0", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "JoLv", + "available": false, + "extension": "mp4", + "file_size": 3, + "id": "aafa9631e6bbc84dc09c932e8c82b2cb" + }, + { + "_content": "7RgiW6QyaTuSKkwlEyoqfu6v", + "available": false, + "extension": "mp4", + "file_size": 18, + "id": "0fde13127102b53ffea38972bfa95043" + }, + { + "_content": "FB7fxb9vERF61jFOzR5LK4/y", + "available": false, + "extension": "vtt", + "file_size": 18, + "id": "9e2eb65ed17406ada4560db84996543d" + }, + { + "_content": "0YmBAO7sls1NFczL+n/WacS8yb/z", + "available": false, + "extension": "png", + "file_size": 21, + "id": "13d7bbfd951422a82f5ac9d52edc6f29" + }, + { + "_content": "ZTwRpfp8fxOKpEc5xU8hOdU=", + "available": false, + "extension": "jpeg", + "file_size": 17, + "id": "ad65c8a19b842a7cbff69c1d1928c0f1" + }, + { + "_content": "xZ0cGX/htbNSurG62g==", + "available": false, + "extension": "zip", + "file_size": 13, + "id": "16f88b1efa6d0c668648cfb4c6dd68ce" + }, + { + "_content": "BAxssbq5qTZ2yyI=", + "available": false, + "extension": "jpeg", + "file_size": 11, + "id": "2059ca40f0490ba62b32cdf39d0d351d" + }, + { + "_content": "QkVPv2ewZS84lKPg", + "available": false, + "extension": "epub", + "file_size": 12, + "id": "101cff6e0ff355085294d891e5a33011" + }, + { + "_content": "mc4LaAKXrEljtz/0d1lWdb2UHA==", + "available": false, + "extension": "png", + "file_size": 19, + "id": "b1f82e3d35c86ccb20882ab5f1c2321c" + }, + { + "_content": "A76U98QFtSj+g1oJCs2pHQmzeM2ouw==", + "available": false, + "extension": "mp3", + "file_size": 22, + "id": "d61658cf80ebc8079fd97dabac1b4cd0" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/817c628f90db40f2b489191c82e203c6.json b/kolibri_explore_plugin/test/channels/817c628f90db40f2b489191c82e203c6.json new file mode 100644 index 000000000..e57edfd29 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/817c628f90db40f2b489191c82e203c6.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "817c628f90db40f2b489191c82e203c6", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "817c628f90db40f2b489191c82e203c6", + "tagline": null, + "thumbnail": "data:image/jpg;base64,vAuvSxhqQV0PMgn7WbDxpaZ/iscdWsvt2W6Fg4V4", + "version": 1 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "817c628f90db40f2b489191c82e203c6", + "coach_content": false, + "content_id": "817c628f90db40f2b489191c82e203c6", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "817c628f90db40f2b489191c82e203c6", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "817c628f90db40f2b489191c82e203c6", + "coach_content": false, + "content_id": "ad39ec880bf041bfad582c873eb5105e", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "2624218309a946428b4893c9d529f705", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "817c628f90db40f2b489191c82e203c6", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "817c628f90db40f2b489191c82e203c6", + "coach_content": false, + "content_id": "d36466fdd5c74839a16c177f4ceeb017", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "e3a698d55ade4a11ba322c65aebb227e", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "817c628f90db40f2b489191c82e203c6", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "817c628f90db40f2b489191c82e203c6", + "coach_content": false, + "content_id": "97ac8c7e40b441b694a745184dfabd4b", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "63fc791281a9488394630d4162731ad4", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "e3a698d55ade4a11ba322c65aebb227e", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "817c628f90db40f2b489191c82e203c6", + "coach_content": false, + "content_id": "b65edd969bc24bccb0b3cf1a5283a506", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "40ceecf41e10437aa299b43885f6c01b", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "e3a698d55ade4a11ba322c65aebb227e", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "817c628f90db40f2b489191c82e203c6", + "coach_content": false, + "content_id": "02d2ca5732d944a5b1f8d7645dde0151", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "d86ea3351f694ec583bef8d9a1659aa7", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "e3a698d55ade4a11ba322c65aebb227e", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "2624218309a946428b4893c9d529f705", + "id": 1, + "to_contentnode_id": "817c628f90db40f2b489191c82e203c6" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "2624218309a946428b4893c9d529f705", + "id": 1, + "to_contentnode_id": "e3a698d55ade4a11ba322c65aebb227e" + }, + { + "from_contentnode_id": "e3a698d55ade4a11ba322c65aebb227e", + "id": 2, + "to_contentnode_id": "2624218309a946428b4893c9d529f705" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "817c628f90db40f2b489191c82e203c6", + "contenttag_id": "013d1816f94642fb8756597dae0b86f0", + "id": 1 + }, + { + "contentnode_id": "817c628f90db40f2b489191c82e203c6", + "contenttag_id": "2ba97582150e4e7986131ab9044768fe", + "id": 2 + }, + { + "contentnode_id": "817c628f90db40f2b489191c82e203c6", + "contenttag_id": "45c406f6a0734c84836f04e1e301e6b3", + "id": 3 + }, + { + "contentnode_id": "2624218309a946428b4893c9d529f705", + "contenttag_id": "013d1816f94642fb8756597dae0b86f0", + "id": 4 + }, + { + "contentnode_id": "e3a698d55ade4a11ba322c65aebb227e", + "contenttag_id": "2ba97582150e4e7986131ab9044768fe", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "013d1816f94642fb8756597dae0b86f0", + "tag_name": "tag_1" + }, + { + "id": "2ba97582150e4e7986131ab9044768fe", + "tag_name": "tag_2" + }, + { + "id": "45c406f6a0734c84836f04e1e301e6b3", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "2624218309a946428b4893c9d529f705", + "id": "96c2224092784e728d485f5ca4ae4027", + "lang_id": "en", + "local_file_id": "ab3704787977cc5926df7f2361e487d7", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "2624218309a946428b4893c9d529f705", + "id": "d1441d03a5704d31933c1e657e0f7b37", + "lang_id": "en", + "local_file_id": "275980f562008da283fbd53b02c7a41d", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "2624218309a946428b4893c9d529f705", + "id": "f9eccd34590545e19a16c8e5ff3a4e39", + "lang_id": null, + "local_file_id": "84c0e454601e927435a9dba918b814cc", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "2624218309a946428b4893c9d529f705", + "id": "48dba3164c664dc6b2963061664013f5", + "lang_id": null, + "local_file_id": "abede7f3a9218d0712b6e5e746178500", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "e3a698d55ade4a11ba322c65aebb227e", + "id": "d5aeebc50ba94eb0b1f81d245634fc3c", + "lang_id": null, + "local_file_id": "58c89562f58fd276f592420068db8c09", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "63fc791281a9488394630d4162731ad4", + "id": "c15fab1168504f86b97d2e62b301e2cf", + "lang_id": "3", + "local_file_id": "99bb19e8863c5217308d9dae19798476", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "63fc791281a9488394630d4162731ad4", + "id": "435f617769104a7fbba5d8282c6c624d", + "lang_id": null, + "local_file_id": "b780ed808d2796a1a35ea1ef86fe0f0b", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "40ceecf41e10437aa299b43885f6c01b", + "id": "062f11815553446c952a3ab56f88cb66", + "lang_id": null, + "local_file_id": "fb6d3933c195c16b27313743d62d3e17", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "40ceecf41e10437aa299b43885f6c01b", + "id": "cc4915900d6347829fe7d500eb59fcea", + "lang_id": null, + "local_file_id": "b19a6d7dbfff2210518afe4eab48df37", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "d86ea3351f694ec583bef8d9a1659aa7", + "id": "cb5afbb80cba4309ba8d374b598e638f", + "lang_id": null, + "local_file_id": "b14b37e2b91965cb6614b220572b92c1", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "6U+hWZRaWGWYiDu3Wbr11hWj", + "available": false, + "extension": "mp4", + "file_size": 18, + "id": "ab3704787977cc5926df7f2361e487d7" + }, + { + "_content": "VeouSid15dnNuYVWVg==", + "available": false, + "extension": "mp4", + "file_size": 13, + "id": "275980f562008da283fbd53b02c7a41d" + }, + { + "_content": "vDXp3Etf47aRQ7kp33Pd74uwMbG8hHRZBCpd2RY=", + "available": false, + "extension": "vtt", + "file_size": 29, + "id": "84c0e454601e927435a9dba918b814cc" + }, + { + "_content": "iFfqSrZQrzPxjCbCkvg17r096oXoEHoRQ7oUduWr", + "available": false, + "extension": "png", + "file_size": 30, + "id": "abede7f3a9218d0712b6e5e746178500" + }, + { + "_content": "DA==", + "available": false, + "extension": "jpeg", + "file_size": 1, + "id": "58c89562f58fd276f592420068db8c09" + }, + { + "_content": "RJopAI0ZeKxjxQ8RMhIxKFCeQhPzU1qT", + "available": false, + "extension": "zip", + "file_size": 24, + "id": "99bb19e8863c5217308d9dae19798476" + }, + { + "_content": "+Z4qdQDJtrnukOgym5cG", + "available": false, + "extension": "jpeg", + "file_size": 15, + "id": "b780ed808d2796a1a35ea1ef86fe0f0b" + }, + { + "_content": "B3SntZJg5HtiFLMAbJEt", + "available": false, + "extension": "epub", + "file_size": 15, + "id": "fb6d3933c195c16b27313743d62d3e17" + }, + { + "_content": "4AXq", + "available": false, + "extension": "png", + "file_size": 3, + "id": "b19a6d7dbfff2210518afe4eab48df37" + }, + { + "_content": "/wb4dijVukKnJljr+A==", + "available": false, + "extension": "mp3", + "file_size": 13, + "id": "b14b37e2b91965cb6614b220572b92c1" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/89c858dc2dd24512b2eff27ac12d3d4a.json b/kolibri_explore_plugin/test/channels/89c858dc2dd24512b2eff27ac12d3d4a.json new file mode 100644 index 000000000..08efa3118 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/89c858dc2dd24512b2eff27ac12d3d4a.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "89c858dc2dd24512b2eff27ac12d3d4a", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "tagline": null, + "thumbnail": "data:image/jpg;base64,uUYmunjID5AxegfDiuu4QUQQ4baJiG+oSta7OnlM", + "version": 1 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "coach_content": false, + "content_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "89c858dc2dd24512b2eff27ac12d3d4a", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "coach_content": false, + "content_id": "27d6b4cd1a054993ad17e9f29631fb78", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "9570292af3334e4f8286ed89c6e08df4", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "coach_content": false, + "content_id": "b45cfa06d0a34862ac475aac1ccfbe5d", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "ca00272949d34ec3bfe7873476c7b64b", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "coach_content": false, + "content_id": "a35147e2384c46a4b3401517742cf529", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "080d6a8232c5460c95ff2c1483d2bb8e", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "ca00272949d34ec3bfe7873476c7b64b", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "coach_content": false, + "content_id": "6373372f1504485cb3e16a503fc59993", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "f13d86bd78834071b81709c5455c3653", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "ca00272949d34ec3bfe7873476c7b64b", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "coach_content": false, + "content_id": "c2c4ab1ed738441ca6f6d5ee1acdfa16", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "e3a014628dea49b1975a72e12c4a35f8", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "ca00272949d34ec3bfe7873476c7b64b", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "9570292af3334e4f8286ed89c6e08df4", + "id": 1, + "to_contentnode_id": "89c858dc2dd24512b2eff27ac12d3d4a" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "9570292af3334e4f8286ed89c6e08df4", + "id": 1, + "to_contentnode_id": "ca00272949d34ec3bfe7873476c7b64b" + }, + { + "from_contentnode_id": "ca00272949d34ec3bfe7873476c7b64b", + "id": 2, + "to_contentnode_id": "9570292af3334e4f8286ed89c6e08df4" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "contenttag_id": "530f62165b474bd7a509985d618a107e", + "id": 1 + }, + { + "contentnode_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "contenttag_id": "5c0fd2115b3d46809709e6aa5fbb0aa6", + "id": 2 + }, + { + "contentnode_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "contenttag_id": "d7aa8a3fe22e486db7078f7bc31e94ef", + "id": 3 + }, + { + "contentnode_id": "9570292af3334e4f8286ed89c6e08df4", + "contenttag_id": "530f62165b474bd7a509985d618a107e", + "id": 4 + }, + { + "contentnode_id": "ca00272949d34ec3bfe7873476c7b64b", + "contenttag_id": "5c0fd2115b3d46809709e6aa5fbb0aa6", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "530f62165b474bd7a509985d618a107e", + "tag_name": "tag_1" + }, + { + "id": "5c0fd2115b3d46809709e6aa5fbb0aa6", + "tag_name": "tag_2" + }, + { + "id": "d7aa8a3fe22e486db7078f7bc31e94ef", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "9570292af3334e4f8286ed89c6e08df4", + "id": "0da6cd7ae279494c99225a96e55b5ac9", + "lang_id": "en", + "local_file_id": "86e0e8a0d483b7b89146d153b2809809", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "9570292af3334e4f8286ed89c6e08df4", + "id": "6fcae94cd02349678f30e2b7adf8d938", + "lang_id": "en", + "local_file_id": "1f6bef317c98e5d6d032b5942d15b311", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "9570292af3334e4f8286ed89c6e08df4", + "id": "49167287cc994e4b834e09bd349ffe2d", + "lang_id": null, + "local_file_id": "971c90db617881c9800da23efcab18d5", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "9570292af3334e4f8286ed89c6e08df4", + "id": "b9ef2026c14642cb9eb2ba7987319dd2", + "lang_id": null, + "local_file_id": "364b51aa711a1fc4c798db66f8b62345", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "ca00272949d34ec3bfe7873476c7b64b", + "id": "8de7b03bd4ab46c48c1eaa5676281584", + "lang_id": null, + "local_file_id": "1fd7adfe002a982b3461a12be3847069", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "080d6a8232c5460c95ff2c1483d2bb8e", + "id": "1b6f9766e23c43de8a766744165e1495", + "lang_id": "3", + "local_file_id": "6a7b5b6a13afefc54a5c3b8af21ac8e1", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "080d6a8232c5460c95ff2c1483d2bb8e", + "id": "3d97b39bf9ae49b1bc48435e43643c6c", + "lang_id": null, + "local_file_id": "92a411aae6891ce5309dde516d8f9851", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "f13d86bd78834071b81709c5455c3653", + "id": "d9b7eb4af9084e81b26f5e33b22968f1", + "lang_id": null, + "local_file_id": "2dfb43c75ea16a55f27431300deada44", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "f13d86bd78834071b81709c5455c3653", + "id": "8e6c63c76ccd4108b355eb36be27f784", + "lang_id": null, + "local_file_id": "dd2c96d6bfd69d4c9affec06c5eddc7e", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "e3a014628dea49b1975a72e12c4a35f8", + "id": "fc1a3264914a4052a4565d8bd0843616", + "lang_id": null, + "local_file_id": "3bd9f87f11923e53756a757af5c6882e", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "QcCSWmKxDD9w", + "available": false, + "extension": "mp4", + "file_size": 9, + "id": "86e0e8a0d483b7b89146d153b2809809" + }, + { + "_content": "LU3xOQcS", + "available": false, + "extension": "mp4", + "file_size": 6, + "id": "1f6bef317c98e5d6d032b5942d15b311" + }, + { + "_content": "P5m+JEBzglS/", + "available": false, + "extension": "vtt", + "file_size": 9, + "id": "971c90db617881c9800da23efcab18d5" + }, + { + "_content": "zM8tI3Q=", + "available": false, + "extension": "png", + "file_size": 5, + "id": "364b51aa711a1fc4c798db66f8b62345" + }, + { + "_content": "m9Mj6plDP52ZhyPV2A7BlVsqn9gG", + "available": false, + "extension": "jpeg", + "file_size": 21, + "id": "1fd7adfe002a982b3461a12be3847069" + }, + { + "_content": "nWsqC1+77Ya8fbSgNzh9xD0=", + "available": false, + "extension": "zip", + "file_size": 17, + "id": "6a7b5b6a13afefc54a5c3b8af21ac8e1" + }, + { + "_content": "ETOYuoOLAy1BoJCveJMY95PMjZ0e", + "available": false, + "extension": "jpeg", + "file_size": 21, + "id": "92a411aae6891ce5309dde516d8f9851" + }, + { + "_content": "h0pxp9C8ajtJ+SawYFyte9s6Azbk", + "available": false, + "extension": "epub", + "file_size": 21, + "id": "2dfb43c75ea16a55f27431300deada44" + }, + { + "_content": "NEty", + "available": false, + "extension": "png", + "file_size": 3, + "id": "dd2c96d6bfd69d4c9affec06c5eddc7e" + }, + { + "_content": "iOTGmx74rIOeGICevPLJkr0p8BbKXuX1Yzcd", + "available": false, + "extension": "mp3", + "file_size": 27, + "id": "3bd9f87f11923e53756a757af5c6882e" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/9c2e07c1bf8d4f4299e83592eb034020.json b/kolibri_explore_plugin/test/channels/9c2e07c1bf8d4f4299e83592eb034020.json new file mode 100644 index 000000000..1c6fd25f0 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/9c2e07c1bf8d4f4299e83592eb034020.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "9c2e07c1bf8d4f4299e83592eb034020", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "9c2e07c1bf8d4f4299e83592eb034020", + "tagline": null, + "thumbnail": "data:image/jpg;base64,1Wa5D2lbWb8akt9F+5Srq5zIMSQoDi08eeGJTCQ9", + "version": 3 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "9c2e07c1bf8d4f4299e83592eb034020", + "coach_content": false, + "content_id": "9c2e07c1bf8d4f4299e83592eb034020", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "9c2e07c1bf8d4f4299e83592eb034020", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "9c2e07c1bf8d4f4299e83592eb034020", + "coach_content": false, + "content_id": "5b3553b1b9884f55908c11ba9bfe9073", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "035614fb9c614e21871fd271ec8d1e18", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "9c2e07c1bf8d4f4299e83592eb034020", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "9c2e07c1bf8d4f4299e83592eb034020", + "coach_content": false, + "content_id": "85573f4614cf44f9bd6abf2307311214", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "0511ca013d1f4f409ce60cd1ba58844e", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "9c2e07c1bf8d4f4299e83592eb034020", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "9c2e07c1bf8d4f4299e83592eb034020", + "coach_content": false, + "content_id": "e5fc769b81fa46c09469d150b78ba8a1", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "14515a6334dc402ca6496a6fcbe3d7aa", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "0511ca013d1f4f409ce60cd1ba58844e", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "9c2e07c1bf8d4f4299e83592eb034020", + "coach_content": false, + "content_id": "22efa0be7b164bb99c77097c84a7381d", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "f6aa860d9f1c421fa520bf2893dca95d", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "0511ca013d1f4f409ce60cd1ba58844e", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "9c2e07c1bf8d4f4299e83592eb034020", + "coach_content": false, + "content_id": "04058a873fbb4b879d549729897cafa0", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "ad91a2e1903d48b894fc35bc92fe0aea", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "0511ca013d1f4f409ce60cd1ba58844e", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "035614fb9c614e21871fd271ec8d1e18", + "id": 1, + "to_contentnode_id": "9c2e07c1bf8d4f4299e83592eb034020" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "035614fb9c614e21871fd271ec8d1e18", + "id": 1, + "to_contentnode_id": "0511ca013d1f4f409ce60cd1ba58844e" + }, + { + "from_contentnode_id": "0511ca013d1f4f409ce60cd1ba58844e", + "id": 2, + "to_contentnode_id": "035614fb9c614e21871fd271ec8d1e18" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "9c2e07c1bf8d4f4299e83592eb034020", + "contenttag_id": "6aad3923c3b744c289a6eaf35cd322f6", + "id": 1 + }, + { + "contentnode_id": "9c2e07c1bf8d4f4299e83592eb034020", + "contenttag_id": "4035392594f7439cbcfcc4b5bd554a6f", + "id": 2 + }, + { + "contentnode_id": "9c2e07c1bf8d4f4299e83592eb034020", + "contenttag_id": "c13bc55b799f4ba486619b693822d292", + "id": 3 + }, + { + "contentnode_id": "035614fb9c614e21871fd271ec8d1e18", + "contenttag_id": "6aad3923c3b744c289a6eaf35cd322f6", + "id": 4 + }, + { + "contentnode_id": "0511ca013d1f4f409ce60cd1ba58844e", + "contenttag_id": "4035392594f7439cbcfcc4b5bd554a6f", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "6aad3923c3b744c289a6eaf35cd322f6", + "tag_name": "tag_1" + }, + { + "id": "4035392594f7439cbcfcc4b5bd554a6f", + "tag_name": "tag_2" + }, + { + "id": "c13bc55b799f4ba486619b693822d292", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "035614fb9c614e21871fd271ec8d1e18", + "id": "50f505525e294e628decf8fc79e4773b", + "lang_id": "en", + "local_file_id": "8e3b8e8418a902983dd987c1aa555df5", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "035614fb9c614e21871fd271ec8d1e18", + "id": "e625a18516ef45b4847d7e8c50989f92", + "lang_id": "en", + "local_file_id": "4669ee25958bc66a1300a9d9910e29f5", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "035614fb9c614e21871fd271ec8d1e18", + "id": "ada2495714f446f4a7192758d6ab00f0", + "lang_id": null, + "local_file_id": "f8c72c3abed145d2d0376cc5a406c2a5", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "035614fb9c614e21871fd271ec8d1e18", + "id": "0a8ce32509db420588403f19fd4f5eb6", + "lang_id": null, + "local_file_id": "2c72dac5eacfba0743de29daec421289", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "0511ca013d1f4f409ce60cd1ba58844e", + "id": "6c838b0d8c4f4f8aa4175c965044b34d", + "lang_id": null, + "local_file_id": "9a939ee8c2b0a2abc721d6222b5f7b15", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "14515a6334dc402ca6496a6fcbe3d7aa", + "id": "14e653ed04df4472ab1a0b7426026a08", + "lang_id": "3", + "local_file_id": "f034e109850f307c1f15a56d22527a82", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "14515a6334dc402ca6496a6fcbe3d7aa", + "id": "3fd7f64b20054341a9486a57bd2f5139", + "lang_id": null, + "local_file_id": "401127d6f473aea4b8a8e94e4e4c2acb", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "f6aa860d9f1c421fa520bf2893dca95d", + "id": "62b4bf316db9495aa405048e99e6d76c", + "lang_id": null, + "local_file_id": "c64193423eaa4de6095812c2fd4d5500", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "f6aa860d9f1c421fa520bf2893dca95d", + "id": "ff121b290e00485b83f890425468391b", + "lang_id": null, + "local_file_id": "3590cb8af0bbb9e78c343b52b93773c9", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "ad91a2e1903d48b894fc35bc92fe0aea", + "id": "109f58386bfa40428999e42061da09e4", + "lang_id": null, + "local_file_id": "6e248179c08098d80666881d1da7d9a5", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "lztXC5JgijvjsENmvMldjAm70iA=", + "available": false, + "extension": "mp4", + "file_size": 20, + "id": "8e3b8e8418a902983dd987c1aa555df5" + }, + { + "_content": "HfFCd9Jo", + "available": false, + "extension": "mp4", + "file_size": 6, + "id": "4669ee25958bc66a1300a9d9910e29f5" + }, + { + "_content": "CE7DueL9vG+RZudNhUcYGSWFjmfsXbj+19xA1OXC", + "available": false, + "extension": "vtt", + "file_size": 30, + "id": "f8c72c3abed145d2d0376cc5a406c2a5" + }, + { + "_content": "UYMZI5pLotk=", + "available": false, + "extension": "png", + "file_size": 8, + "id": "2c72dac5eacfba0743de29daec421289" + }, + { + "_content": "hB36E0Wayw2UzL7tiatR4EyALQRxzA==", + "available": false, + "extension": "jpeg", + "file_size": 22, + "id": "9a939ee8c2b0a2abc721d6222b5f7b15" + }, + { + "_content": "XwE2", + "available": false, + "extension": "zip", + "file_size": 3, + "id": "f034e109850f307c1f15a56d22527a82" + }, + { + "_content": "fmYoNywu458SFEJwtQkNc39n2gg=", + "available": false, + "extension": "jpeg", + "file_size": 20, + "id": "401127d6f473aea4b8a8e94e4e4c2acb" + }, + { + "_content": "nd2iXwCFhpjz2w==", + "available": false, + "extension": "epub", + "file_size": 10, + "id": "c64193423eaa4de6095812c2fd4d5500" + }, + { + "_content": "Jw==", + "available": false, + "extension": "png", + "file_size": 1, + "id": "3590cb8af0bbb9e78c343b52b93773c9" + }, + { + "_content": "UU125NB6mLdWPQ3c6ONiRwyJGo81a8rVCDEMa53R", + "available": false, + "extension": "mp3", + "file_size": 30, + "id": "6e248179c08098d80666881d1da7d9a5" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/README.md b/kolibri_explore_plugin/test/channels/README.md new file mode 100644 index 000000000..3659a8486 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/README.md @@ -0,0 +1,21 @@ +# Test channel DB data + +Each JSON file represents a Kolibri channel in a format that can be used +to create an sqlite channel database using sqlalchemy. In addition, each +`content_localfile` entry has a `_content` field that represents the +actual file content base64 encoded. This allows the test channel JSON +file to represent a channel and all of its contents. The `_content` +field does not correspond to an actual database field and must be +removed before processing with sqlalchemy. + +Each channel has the same node structure: + +* Root topic with no files + * Video with high res, low res, subtitles and thumbnail files + * Sub topic with thumbnail file + * HTML5 app with zip and thumbnail files + * Document with epub and thumbnail files + * Audio with only mp3 file + +In all there are 6 nodes and 10 files per channel. 4 of the files are +thumbnails. diff --git a/kolibri_explore_plugin/test/channels/b51baf46133045e3bce4d2d872a8f71d.json b/kolibri_explore_plugin/test/channels/b51baf46133045e3bce4d2d872a8f71d.json new file mode 100644 index 000000000..880b14135 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/b51baf46133045e3bce4d2d872a8f71d.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "b51baf46133045e3bce4d2d872a8f71d", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "b51baf46133045e3bce4d2d872a8f71d", + "tagline": null, + "thumbnail": "data:image/jpg;base64,psC1qTiXt5JsgJxuhKHwDHemWkGI1HE2ehSbz2M0", + "version": 1 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "b51baf46133045e3bce4d2d872a8f71d", + "coach_content": false, + "content_id": "b51baf46133045e3bce4d2d872a8f71d", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "b51baf46133045e3bce4d2d872a8f71d", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "b51baf46133045e3bce4d2d872a8f71d", + "coach_content": false, + "content_id": "53849d6ceadb4565b4c06b232e7e6f0f", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "5a24503255ce43d98ebcb25d2b60f024", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "b51baf46133045e3bce4d2d872a8f71d", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "b51baf46133045e3bce4d2d872a8f71d", + "coach_content": false, + "content_id": "97dc406724af4e829e3f45b9bc30892d", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "d766df38aaef49cab940e3c0b6384c52", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "b51baf46133045e3bce4d2d872a8f71d", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "b51baf46133045e3bce4d2d872a8f71d", + "coach_content": false, + "content_id": "c2c71beb54fb4857b835ad056349164c", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "ee0053da78e542e298eb1049772585c9", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "d766df38aaef49cab940e3c0b6384c52", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "b51baf46133045e3bce4d2d872a8f71d", + "coach_content": false, + "content_id": "ff4bdf81f0ba4217bcb3fefcf57d2efa", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "91a1bfc0ede544979f861909b7862537", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "d766df38aaef49cab940e3c0b6384c52", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "b51baf46133045e3bce4d2d872a8f71d", + "coach_content": false, + "content_id": "b179d75a5cc64622a701d2638c70d67b", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "78bb2dc5b7e84380b6d8e374601f338b", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "d766df38aaef49cab940e3c0b6384c52", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "5a24503255ce43d98ebcb25d2b60f024", + "id": 1, + "to_contentnode_id": "b51baf46133045e3bce4d2d872a8f71d" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "5a24503255ce43d98ebcb25d2b60f024", + "id": 1, + "to_contentnode_id": "d766df38aaef49cab940e3c0b6384c52" + }, + { + "from_contentnode_id": "d766df38aaef49cab940e3c0b6384c52", + "id": 2, + "to_contentnode_id": "5a24503255ce43d98ebcb25d2b60f024" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "b51baf46133045e3bce4d2d872a8f71d", + "contenttag_id": "b49113dd955544798fa3ea57c9369d3a", + "id": 1 + }, + { + "contentnode_id": "b51baf46133045e3bce4d2d872a8f71d", + "contenttag_id": "140d0964b95c4a99b9204fff22a221ea", + "id": 2 + }, + { + "contentnode_id": "b51baf46133045e3bce4d2d872a8f71d", + "contenttag_id": "25db9a2e60cf4a70a3e1aa4e945072d9", + "id": 3 + }, + { + "contentnode_id": "5a24503255ce43d98ebcb25d2b60f024", + "contenttag_id": "b49113dd955544798fa3ea57c9369d3a", + "id": 4 + }, + { + "contentnode_id": "d766df38aaef49cab940e3c0b6384c52", + "contenttag_id": "140d0964b95c4a99b9204fff22a221ea", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "b49113dd955544798fa3ea57c9369d3a", + "tag_name": "tag_1" + }, + { + "id": "140d0964b95c4a99b9204fff22a221ea", + "tag_name": "tag_2" + }, + { + "id": "25db9a2e60cf4a70a3e1aa4e945072d9", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "5a24503255ce43d98ebcb25d2b60f024", + "id": "f90f62dab4094f1fba797453a8963c6f", + "lang_id": "en", + "local_file_id": "07b9d951f435314a65cf76c04f592ef0", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "5a24503255ce43d98ebcb25d2b60f024", + "id": "35150265b0014782a12fd409b97327af", + "lang_id": "en", + "local_file_id": "4d5b85001480d64aaf36a4ce797468b4", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "5a24503255ce43d98ebcb25d2b60f024", + "id": "4c6b0c48f80043e6993ab57f92109bbb", + "lang_id": null, + "local_file_id": "99e4abce3b20c4eeaef6e8c6357fb5ac", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "5a24503255ce43d98ebcb25d2b60f024", + "id": "8bf910306ba84f6b963a7f085cad08a1", + "lang_id": null, + "local_file_id": "2c82ebf686ee33e3e716999bc3f40851", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "d766df38aaef49cab940e3c0b6384c52", + "id": "680ab18f4f4b493db8258967744bff91", + "lang_id": null, + "local_file_id": "8e3d82ffb4457bf62fb8c70683ffe84b", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "ee0053da78e542e298eb1049772585c9", + "id": "aeed568195b24c249a86e4780152b437", + "lang_id": "3", + "local_file_id": "2f74da6a66987e9507ad712d7621a238", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "ee0053da78e542e298eb1049772585c9", + "id": "8508b3283f4e4cf1aad4388a899e8e76", + "lang_id": null, + "local_file_id": "09b6da8bd7fe2f23dd359488017ab3ab", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "91a1bfc0ede544979f861909b7862537", + "id": "07a6f4948d21462c8e989bd4a2f6dfe1", + "lang_id": null, + "local_file_id": "86d1e7270a8f7964a0f60306938d8406", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "91a1bfc0ede544979f861909b7862537", + "id": "f2bb2b7538af42588e20fd92d83e7ead", + "lang_id": null, + "local_file_id": "89daf9eeeaa3da8660fa0506e7e4ba7b", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "78bb2dc5b7e84380b6d8e374601f338b", + "id": "31762bf0ca73493b9c77a5722c0724f7", + "lang_id": null, + "local_file_id": "56c57d37af5097eeb9ce9e8573ff242f", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "x+iosrPE49K5rpVDFloekGA73mWgqYTd6AlT", + "available": false, + "extension": "mp4", + "file_size": 27, + "id": "07b9d951f435314a65cf76c04f592ef0" + }, + { + "_content": "F9MCHCd9tT+cfQCoSy0=", + "available": false, + "extension": "mp4", + "file_size": 14, + "id": "4d5b85001480d64aaf36a4ce797468b4" + }, + { + "_content": "UODkBS3ODO5QxqjojKkdpDwb", + "available": false, + "extension": "vtt", + "file_size": 18, + "id": "99e4abce3b20c4eeaef6e8c6357fb5ac" + }, + { + "_content": "1kFOj8IKKuK3YcNHmOe+Hyiueux7Fuc=", + "available": false, + "extension": "png", + "file_size": 23, + "id": "2c82ebf686ee33e3e716999bc3f40851" + }, + { + "_content": "LI8zRw==", + "available": false, + "extension": "jpeg", + "file_size": 4, + "id": "8e3d82ffb4457bf62fb8c70683ffe84b" + }, + { + "_content": "iE6m6D7eRWadTyxQVpY6SOcWGMjCTjJSGBZPvNDG", + "available": false, + "extension": "zip", + "file_size": 30, + "id": "2f74da6a66987e9507ad712d7621a238" + }, + { + "_content": "tM5Zd+p3vBID6XYivtJM", + "available": false, + "extension": "jpeg", + "file_size": 15, + "id": "09b6da8bd7fe2f23dd359488017ab3ab" + }, + { + "_content": "z6G039KcNmzRbE6IO2c=", + "available": false, + "extension": "epub", + "file_size": 14, + "id": "86d1e7270a8f7964a0f60306938d8406" + }, + { + "_content": "SawYe7onMtA/", + "available": false, + "extension": "png", + "file_size": 9, + "id": "89daf9eeeaa3da8660fa0506e7e4ba7b" + }, + { + "_content": "ELB8D7O42EZgPGOferGtR6seAdvC2bJG0g==", + "available": false, + "extension": "mp3", + "file_size": 25, + "id": "56c57d37af5097eeb9ce9e8573ff242f" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/b77bba2e4b884813b8e22d63b964fb73.json b/kolibri_explore_plugin/test/channels/b77bba2e4b884813b8e22d63b964fb73.json new file mode 100644 index 000000000..fc55be8cd --- /dev/null +++ b/kolibri_explore_plugin/test/channels/b77bba2e4b884813b8e22d63b964fb73.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "b77bba2e4b884813b8e22d63b964fb73", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "b77bba2e4b884813b8e22d63b964fb73", + "tagline": null, + "thumbnail": "data:image/jpg;base64,NEIUGicxi0I1VqINw1zfjvFjTwQeqGP7oBZaDAge", + "version": 3 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "b77bba2e4b884813b8e22d63b964fb73", + "coach_content": false, + "content_id": "b77bba2e4b884813b8e22d63b964fb73", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "b77bba2e4b884813b8e22d63b964fb73", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "b77bba2e4b884813b8e22d63b964fb73", + "coach_content": false, + "content_id": "c4874e0785584a85af0e6bc9994af303", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "05755d03082c4444a3b0fef1e72d7219", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "b77bba2e4b884813b8e22d63b964fb73", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "b77bba2e4b884813b8e22d63b964fb73", + "coach_content": false, + "content_id": "2bd2a5e5814e4dbcb1a7fe112345698d", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "e90e1bf7adc6450b95d07b524622bc15", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "b77bba2e4b884813b8e22d63b964fb73", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "b77bba2e4b884813b8e22d63b964fb73", + "coach_content": false, + "content_id": "af44679e6335403dbed868fd5eb798f8", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "e53f0ed52ad34857852f38127aaa4837", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "e90e1bf7adc6450b95d07b524622bc15", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "b77bba2e4b884813b8e22d63b964fb73", + "coach_content": false, + "content_id": "7bf3ca85d0ac4edcbce5c8323ea1ad49", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "7c251a8e820545e49fbe21b53194e433", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "e90e1bf7adc6450b95d07b524622bc15", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "b77bba2e4b884813b8e22d63b964fb73", + "coach_content": false, + "content_id": "6f933b20024c4f68bca87c252b4bc2cc", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "b39a8d3fdc9a44508f89bab184d58037", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "e90e1bf7adc6450b95d07b524622bc15", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "05755d03082c4444a3b0fef1e72d7219", + "id": 1, + "to_contentnode_id": "b77bba2e4b884813b8e22d63b964fb73" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "05755d03082c4444a3b0fef1e72d7219", + "id": 1, + "to_contentnode_id": "e90e1bf7adc6450b95d07b524622bc15" + }, + { + "from_contentnode_id": "e90e1bf7adc6450b95d07b524622bc15", + "id": 2, + "to_contentnode_id": "05755d03082c4444a3b0fef1e72d7219" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "b77bba2e4b884813b8e22d63b964fb73", + "contenttag_id": "95ddb255626141deb43ed1b6f5862d3f", + "id": 1 + }, + { + "contentnode_id": "b77bba2e4b884813b8e22d63b964fb73", + "contenttag_id": "c572534cd83145a0a3bef7c905ea23e5", + "id": 2 + }, + { + "contentnode_id": "b77bba2e4b884813b8e22d63b964fb73", + "contenttag_id": "15dd246cf077432a821553b9866a81f4", + "id": 3 + }, + { + "contentnode_id": "05755d03082c4444a3b0fef1e72d7219", + "contenttag_id": "95ddb255626141deb43ed1b6f5862d3f", + "id": 4 + }, + { + "contentnode_id": "e90e1bf7adc6450b95d07b524622bc15", + "contenttag_id": "c572534cd83145a0a3bef7c905ea23e5", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "95ddb255626141deb43ed1b6f5862d3f", + "tag_name": "tag_1" + }, + { + "id": "c572534cd83145a0a3bef7c905ea23e5", + "tag_name": "tag_2" + }, + { + "id": "15dd246cf077432a821553b9866a81f4", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "05755d03082c4444a3b0fef1e72d7219", + "id": "a906d466aec5465bbbadea8bbbfd05cd", + "lang_id": "en", + "local_file_id": "b3c532e5686ed42d8ead580db2414fd3", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "05755d03082c4444a3b0fef1e72d7219", + "id": "19dc7604a3cc42c2b49c45a9eaf66f9e", + "lang_id": "en", + "local_file_id": "23b28409679370bd7bb44349fe93a935", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "05755d03082c4444a3b0fef1e72d7219", + "id": "16bee742982949ca8e5b4e66d38faaf6", + "lang_id": null, + "local_file_id": "3d53ef9560f8fd846c41bdd2500574d6", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "05755d03082c4444a3b0fef1e72d7219", + "id": "e9baf0170805466bbde6692dd2e5e937", + "lang_id": null, + "local_file_id": "de2a0fcc705d076a62458ce40458df64", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "e90e1bf7adc6450b95d07b524622bc15", + "id": "05d3b63504124b0c8961fe86cd568e65", + "lang_id": null, + "local_file_id": "8e6fc77d685e3e635c2710d8738c54fc", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "e53f0ed52ad34857852f38127aaa4837", + "id": "567ae2ff4ad84ea58c77ccb2e507032c", + "lang_id": "3", + "local_file_id": "1067969effb583eb842f8d66757ccb2d", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "e53f0ed52ad34857852f38127aaa4837", + "id": "5285908f342c497b955aaabeb4b0c0aa", + "lang_id": null, + "local_file_id": "9e16223b6ccfd06aebed44c7704da4df", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "7c251a8e820545e49fbe21b53194e433", + "id": "c4c09bcffef64b508e3fc62bf53c26ec", + "lang_id": null, + "local_file_id": "cfc291a7598278207475413bd2045abe", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "7c251a8e820545e49fbe21b53194e433", + "id": "54da4533e5e9492cbe81e6814183fc51", + "lang_id": null, + "local_file_id": "6abde88a00df646ea815b5329de982fb", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "b39a8d3fdc9a44508f89bab184d58037", + "id": "22cc7c01e59d4d5a8c489d2e6b360186", + "lang_id": null, + "local_file_id": "cfb5ff555a21cd2d6a1c74f327f61fac", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "F4LzSUFeOZQu/b8tLOBmNtHdCxDQnuB/xBc=", + "available": false, + "extension": "mp4", + "file_size": 26, + "id": "b3c532e5686ed42d8ead580db2414fd3" + }, + { + "_content": "aoT3sAXClHL+YBbSc8FqJodlxclCxl/TdMx6WIk=", + "available": false, + "extension": "mp4", + "file_size": 29, + "id": "23b28409679370bd7bb44349fe93a935" + }, + { + "_content": "FGE=", + "available": false, + "extension": "vtt", + "file_size": 2, + "id": "3d53ef9560f8fd846c41bdd2500574d6" + }, + { + "_content": "FdU=", + "available": false, + "extension": "png", + "file_size": 2, + "id": "de2a0fcc705d076a62458ce40458df64" + }, + { + "_content": "ZR9+A8IwW4R2uGpFXaHehEn7b/oTnJ8Jh9o3vQ==", + "available": false, + "extension": "jpeg", + "file_size": 28, + "id": "8e6fc77d685e3e635c2710d8738c54fc" + }, + { + "_content": "4yhGGQx1v5q2itf2gns=", + "available": false, + "extension": "zip", + "file_size": 14, + "id": "1067969effb583eb842f8d66757ccb2d" + }, + { + "_content": "/k7BWEgiv6BgGxs=", + "available": false, + "extension": "jpeg", + "file_size": 11, + "id": "9e16223b6ccfd06aebed44c7704da4df" + }, + { + "_content": "Dfw7eQ==", + "available": false, + "extension": "epub", + "file_size": 4, + "id": "cfc291a7598278207475413bd2045abe" + }, + { + "_content": "Jqm7oEIWRsThCVJuQWyNGpk=", + "available": false, + "extension": "png", + "file_size": 17, + "id": "6abde88a00df646ea815b5329de982fb" + }, + { + "_content": "BxP1jVXrLok=", + "available": false, + "extension": "mp3", + "file_size": 8, + "id": "cfb5ff555a21cd2d6a1c74f327f61fac" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/be6a104a25d44c5682075c54f268eb43.json b/kolibri_explore_plugin/test/channels/be6a104a25d44c5682075c54f268eb43.json new file mode 100644 index 000000000..5ae17d3b7 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/be6a104a25d44c5682075c54f268eb43.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "be6a104a25d44c5682075c54f268eb43", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "be6a104a25d44c5682075c54f268eb43", + "tagline": null, + "thumbnail": "data:image/jpg;base64,dm7lxHR+vrklDrtEHJAwus6rbGq6/1pgS53qQYYw", + "version": 2 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "be6a104a25d44c5682075c54f268eb43", + "coach_content": false, + "content_id": "be6a104a25d44c5682075c54f268eb43", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "be6a104a25d44c5682075c54f268eb43", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "be6a104a25d44c5682075c54f268eb43", + "coach_content": false, + "content_id": "098304c7f7404075bd3bcc8f4ab1e0e7", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "91c4871f3b924c2fbfcdccbead2f11da", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "be6a104a25d44c5682075c54f268eb43", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "be6a104a25d44c5682075c54f268eb43", + "coach_content": false, + "content_id": "e5b3a235f02240089631c8831fceec0d", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "ac796cabd71347449c21a9d6c79d5293", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "be6a104a25d44c5682075c54f268eb43", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "be6a104a25d44c5682075c54f268eb43", + "coach_content": false, + "content_id": "af46c13f5a7544d09d28c56df84d7934", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "ea2a4c0f028245aeb58ae7dd1e0761eb", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "ac796cabd71347449c21a9d6c79d5293", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "be6a104a25d44c5682075c54f268eb43", + "coach_content": false, + "content_id": "3e78c4c941b64bbda50b770102cd559a", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "c6dd8fb6b5c54da2968117e9b27a20cf", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "ac796cabd71347449c21a9d6c79d5293", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "be6a104a25d44c5682075c54f268eb43", + "coach_content": false, + "content_id": "0817f36c0b4e4cfbbee335f41cc3a570", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "08744d55a42741a0bfe2ba2f28e2ef5f", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "ac796cabd71347449c21a9d6c79d5293", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "91c4871f3b924c2fbfcdccbead2f11da", + "id": 1, + "to_contentnode_id": "be6a104a25d44c5682075c54f268eb43" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "91c4871f3b924c2fbfcdccbead2f11da", + "id": 1, + "to_contentnode_id": "ac796cabd71347449c21a9d6c79d5293" + }, + { + "from_contentnode_id": "ac796cabd71347449c21a9d6c79d5293", + "id": 2, + "to_contentnode_id": "91c4871f3b924c2fbfcdccbead2f11da" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "be6a104a25d44c5682075c54f268eb43", + "contenttag_id": "c351b080acc049ba9452ef5057acd395", + "id": 1 + }, + { + "contentnode_id": "be6a104a25d44c5682075c54f268eb43", + "contenttag_id": "32d5905b720b47289e3918fe75b09879", + "id": 2 + }, + { + "contentnode_id": "be6a104a25d44c5682075c54f268eb43", + "contenttag_id": "f69b25a7a47b4a5a973a75d46b5a2443", + "id": 3 + }, + { + "contentnode_id": "91c4871f3b924c2fbfcdccbead2f11da", + "contenttag_id": "c351b080acc049ba9452ef5057acd395", + "id": 4 + }, + { + "contentnode_id": "ac796cabd71347449c21a9d6c79d5293", + "contenttag_id": "32d5905b720b47289e3918fe75b09879", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "c351b080acc049ba9452ef5057acd395", + "tag_name": "tag_1" + }, + { + "id": "32d5905b720b47289e3918fe75b09879", + "tag_name": "tag_2" + }, + { + "id": "f69b25a7a47b4a5a973a75d46b5a2443", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "91c4871f3b924c2fbfcdccbead2f11da", + "id": "7c97afb9ccf247899a4f684f50ddb0e4", + "lang_id": "en", + "local_file_id": "fcdfb39062a95b0c49aa68bf9183439c", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "91c4871f3b924c2fbfcdccbead2f11da", + "id": "a51749d5d5ed4f8089c4f223a6a1006e", + "lang_id": "en", + "local_file_id": "1af02de9d9be8623bceabf4d37abede2", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "91c4871f3b924c2fbfcdccbead2f11da", + "id": "cc544b784200436e9da413f355be4ec2", + "lang_id": null, + "local_file_id": "da1baca9d64e95a60aa90723950ad587", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "91c4871f3b924c2fbfcdccbead2f11da", + "id": "c723bba0ad5e41738c56976df3c97a10", + "lang_id": null, + "local_file_id": "b10a76942a97dcf97fbe00d2f947602a", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "ac796cabd71347449c21a9d6c79d5293", + "id": "d0402bda4ec8455ebbea6064c9fe20e1", + "lang_id": null, + "local_file_id": "e90061846cc405cecc31adb81541e0c8", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "ea2a4c0f028245aeb58ae7dd1e0761eb", + "id": "db4ffbe14b5e4bdcb5de24cd0ef0da45", + "lang_id": "3", + "local_file_id": "a52d6e733a42d817e56e5275c24eac05", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "ea2a4c0f028245aeb58ae7dd1e0761eb", + "id": "48e9d8abcefd463c8c0df45df9bfb1ba", + "lang_id": null, + "local_file_id": "81a0a27f4cf733d30a27ccce93621c9f", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "c6dd8fb6b5c54da2968117e9b27a20cf", + "id": "73818769cc2441b482a2c491322a9459", + "lang_id": null, + "local_file_id": "e356202311b26db2055139c7603c6436", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "c6dd8fb6b5c54da2968117e9b27a20cf", + "id": "3a317877b32f451185f99676c56668f0", + "lang_id": null, + "local_file_id": "465db1fa1413173370e75aa7dbc5ef90", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "08744d55a42741a0bfe2ba2f28e2ef5f", + "id": "6df6cff4a7cb47419e2f19e1a9af4406", + "lang_id": null, + "local_file_id": "cd0fd7b710f204d11a80eac7dfd9aad8", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "afEADYMrQdUGHVQBpRgMboYL/mMrjoL/Dc4JkA==", + "available": false, + "extension": "mp4", + "file_size": 28, + "id": "fcdfb39062a95b0c49aa68bf9183439c" + }, + { + "_content": "F2X4vRZGbw==", + "available": false, + "extension": "mp4", + "file_size": 7, + "id": "1af02de9d9be8623bceabf4d37abede2" + }, + { + "_content": "936khhmcTyOfxf0Dyg==", + "available": false, + "extension": "vtt", + "file_size": 13, + "id": "da1baca9d64e95a60aa90723950ad587" + }, + { + "_content": "CXyIxjNV3F+lCfRhrlYDYNUVxMLn", + "available": false, + "extension": "png", + "file_size": 21, + "id": "b10a76942a97dcf97fbe00d2f947602a" + }, + { + "_content": "grW+HAY4CtjDiP0=", + "available": false, + "extension": "jpeg", + "file_size": 11, + "id": "e90061846cc405cecc31adb81541e0c8" + }, + { + "_content": "own+GplHVV34SIVi58GT3Ldhy3FOM8RDeg==", + "available": false, + "extension": "zip", + "file_size": 25, + "id": "a52d6e733a42d817e56e5275c24eac05" + }, + { + "_content": "ZpcMHEyZaozC/PHNfELnxTB5ihfVUf8yWaeWM7G7", + "available": false, + "extension": "jpeg", + "file_size": 30, + "id": "81a0a27f4cf733d30a27ccce93621c9f" + }, + { + "_content": "utDd/unxqvdOJJHwnpfgJAE=", + "available": false, + "extension": "epub", + "file_size": 17, + "id": "e356202311b26db2055139c7603c6436" + }, + { + "_content": "gTDNGKPiVl6oOGvuuMW/TEbPr+KgLuwb", + "available": false, + "extension": "png", + "file_size": 24, + "id": "465db1fa1413173370e75aa7dbc5ef90" + }, + { + "_content": "RZtY+jewXtpYedKbiyR1YbWW1rM3eA==", + "available": false, + "extension": "mp3", + "file_size": 22, + "id": "cd0fd7b710f204d11a80eac7dfd9aad8" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/dabc98a59edb40c0b4722d5e3df48bbc.json b/kolibri_explore_plugin/test/channels/dabc98a59edb40c0b4722d5e3df48bbc.json new file mode 100644 index 000000000..d4a6921d5 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/dabc98a59edb40c0b4722d5e3df48bbc.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "dabc98a59edb40c0b4722d5e3df48bbc", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "tagline": null, + "thumbnail": "data:image/jpg;base64,wL/DPKEI7XMLekTc6csV6Q/4VoSL1rbLNfRDTZLi", + "version": 2 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "coach_content": false, + "content_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "dabc98a59edb40c0b4722d5e3df48bbc", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "coach_content": false, + "content_id": "0391ec17361d4e40a74afc8d9ee7cd16", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "8ac97da8b5844a2ea711ea2d983590c2", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "coach_content": false, + "content_id": "47be9436a99041f7bdac16450d60ec38", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "a121df78eeb84b8db16137b3b6cbb466", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "coach_content": false, + "content_id": "2cf18be3effd4313a41a5e6c0d7080e3", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "778dec6cb000464ab8e192ac6dd60fb9", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "a121df78eeb84b8db16137b3b6cbb466", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "coach_content": false, + "content_id": "2dfa9cc3d5fa4e0fbf79b50568c5d760", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "b14211a57b434fc5a1d068c56046ee57", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "a121df78eeb84b8db16137b3b6cbb466", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "coach_content": false, + "content_id": "8989f3577afb4691b32beb32fe3880f3", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "31d8f4e67c5c42cc9a617b8bb4d3e0b5", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "a121df78eeb84b8db16137b3b6cbb466", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "8ac97da8b5844a2ea711ea2d983590c2", + "id": 1, + "to_contentnode_id": "dabc98a59edb40c0b4722d5e3df48bbc" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "8ac97da8b5844a2ea711ea2d983590c2", + "id": 1, + "to_contentnode_id": "a121df78eeb84b8db16137b3b6cbb466" + }, + { + "from_contentnode_id": "a121df78eeb84b8db16137b3b6cbb466", + "id": 2, + "to_contentnode_id": "8ac97da8b5844a2ea711ea2d983590c2" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "contenttag_id": "e2a8bc5e10834da185365ff8152956fc", + "id": 1 + }, + { + "contentnode_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "contenttag_id": "4c2b36bb55f14ddda0cd5b8d5c442c2b", + "id": 2 + }, + { + "contentnode_id": "dabc98a59edb40c0b4722d5e3df48bbc", + "contenttag_id": "16633538c3954d509ac3e9a38807fa82", + "id": 3 + }, + { + "contentnode_id": "8ac97da8b5844a2ea711ea2d983590c2", + "contenttag_id": "e2a8bc5e10834da185365ff8152956fc", + "id": 4 + }, + { + "contentnode_id": "a121df78eeb84b8db16137b3b6cbb466", + "contenttag_id": "4c2b36bb55f14ddda0cd5b8d5c442c2b", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "e2a8bc5e10834da185365ff8152956fc", + "tag_name": "tag_1" + }, + { + "id": "4c2b36bb55f14ddda0cd5b8d5c442c2b", + "tag_name": "tag_2" + }, + { + "id": "16633538c3954d509ac3e9a38807fa82", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "8ac97da8b5844a2ea711ea2d983590c2", + "id": "95dea03730c44482850ca4ba9a0bf205", + "lang_id": "en", + "local_file_id": "310a34087806f7a983b6f1388f56cc3f", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "8ac97da8b5844a2ea711ea2d983590c2", + "id": "a24ea755e8ad4d2189e58a63413ad292", + "lang_id": "en", + "local_file_id": "0433cee2a73a1b5ebd49ccb94cdea89f", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "8ac97da8b5844a2ea711ea2d983590c2", + "id": "b882e48361174d2a98bbf30876e6fa37", + "lang_id": null, + "local_file_id": "ab1fe91f2865c48f8d120fa0ef4ca08d", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "8ac97da8b5844a2ea711ea2d983590c2", + "id": "84eceaeedb9f4825aa6a9e2ec5edb68c", + "lang_id": null, + "local_file_id": "c9ce419881bbf6b2160692e79291ca48", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "a121df78eeb84b8db16137b3b6cbb466", + "id": "bedacce96e7c4ff0a3805aa76e57b839", + "lang_id": null, + "local_file_id": "eabde56c458cfcc573d42f52e54b3748", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "778dec6cb000464ab8e192ac6dd60fb9", + "id": "535c6a25a33e415bb48a297dc54f341a", + "lang_id": "3", + "local_file_id": "681064f10033ed5977311c2d0985e4a2", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "778dec6cb000464ab8e192ac6dd60fb9", + "id": "d28e3b8ca2ec452393cea6fa8d3ba625", + "lang_id": null, + "local_file_id": "8932776119873ab7a432b70c1ac15e97", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "b14211a57b434fc5a1d068c56046ee57", + "id": "2a91c80651c1466c8b72cb3befab140a", + "lang_id": null, + "local_file_id": "efb18d6ba7aa1d32cbee7765f57d706a", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "b14211a57b434fc5a1d068c56046ee57", + "id": "454c999d8445491b8d6b72fec0103231", + "lang_id": null, + "local_file_id": "36cf6fd89a73adc0b6abaa69968c3070", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "31d8f4e67c5c42cc9a617b8bb4d3e0b5", + "id": "4dab6ba9ec8f486ba6ea565902478f44", + "lang_id": null, + "local_file_id": "8dbde86873a27013227b16a27a2ba604", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "ojNqnNk5viD45jWz+uNwxdee", + "available": false, + "extension": "mp4", + "file_size": 18, + "id": "310a34087806f7a983b6f1388f56cc3f" + }, + { + "_content": "qUZLnDs1VIiXDU7LZ/dvJc20Q+ND9vB7fCg=", + "available": false, + "extension": "mp4", + "file_size": 26, + "id": "0433cee2a73a1b5ebd49ccb94cdea89f" + }, + { + "_content": "WaDJwmt2AkTqMNsbLIaILUxE", + "available": false, + "extension": "vtt", + "file_size": 18, + "id": "ab1fe91f2865c48f8d120fa0ef4ca08d" + }, + { + "_content": "1wjE69za1caJiXysGjPn6VkKCHPN2JbteNvBQA==", + "available": false, + "extension": "png", + "file_size": 28, + "id": "c9ce419881bbf6b2160692e79291ca48" + }, + { + "_content": "tEVTKONd", + "available": false, + "extension": "jpeg", + "file_size": 6, + "id": "eabde56c458cfcc573d42f52e54b3748" + }, + { + "_content": "AViCafHhCTTPEAY=", + "available": false, + "extension": "zip", + "file_size": 11, + "id": "681064f10033ed5977311c2d0985e4a2" + }, + { + "_content": "4JxiIvXg3M7tt2YbDt4=", + "available": false, + "extension": "jpeg", + "file_size": 14, + "id": "8932776119873ab7a432b70c1ac15e97" + }, + { + "_content": "wfwoyu0lzvJe", + "available": false, + "extension": "epub", + "file_size": 9, + "id": "efb18d6ba7aa1d32cbee7765f57d706a" + }, + { + "_content": "1GHfvWiL8Vjr6oA1lku+", + "available": false, + "extension": "png", + "file_size": 15, + "id": "36cf6fd89a73adc0b6abaa69968c3070" + }, + { + "_content": "oY68EgB6Jvs=", + "available": false, + "extension": "mp3", + "file_size": 8, + "id": "8dbde86873a27013227b16a27a2ba604" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/db.json.template b/kolibri_explore_plugin/test/channels/db.json.template new file mode 100644 index 000000000..19bde3d84 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/db.json.template @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "6199dde695db4ee4ab392222d5af1e5c", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "6199dde695db4ee4ab392222d5af1e5c", + "tagline": null, + "thumbnail": "", + "version": 0 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "6199dde695db4ee4ab392222d5af1e5c", + "coach_content": false, + "content_id": "6199dde695db4ee4ab392222d5af1e5c", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "6199dde695db4ee4ab392222d5af1e5c", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "6199dde695db4ee4ab392222d5af1e5c", + "coach_content": false, + "content_id": "c6f49ea527824f398f4d5d26faf19396", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "32a941fb77c2576e8f6b294cde4c3b0c", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "6199dde695db4ee4ab392222d5af1e5c", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "6199dde695db4ee4ab392222d5af1e5c", + "coach_content": false, + "content_id": "1fe38e5af42f42678f8db66a18f8267a", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "2e8bac07947855369fe2d77642dfc870", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "6199dde695db4ee4ab392222d5af1e5c", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "6199dde695db4ee4ab392222d5af1e5c", + "coach_content": false, + "content_id": "ce603df7c46b424b934348995e1b05fb", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "2b6926ed22025518a8b9da91745b51d3", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "2e8bac07947855369fe2d77642dfc870", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "6199dde695db4ee4ab392222d5af1e5c", + "coach_content": false, + "content_id": "481e1bda1faa445d801ceb2afbd2f42f", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "4d0c890de9b65d6880ccfa527800e0f4", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "2e8bac07947855369fe2d77642dfc870", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "6199dde695db4ee4ab392222d5af1e5c", + "coach_content": false, + "content_id": "f2332710c2fd483386cdeb5ecbdda81f", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "b391bfeec8a458f89f013cf1ca9cf33a", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "2e8bac07947855369fe2d77642dfc870", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "32a941fb77c2576e8f6b294cde4c3b0c", + "id": 1, + "to_contentnode_id": "6199dde695db4ee4ab392222d5af1e5c" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "32a941fb77c2576e8f6b294cde4c3b0c", + "id": 1, + "to_contentnode_id": "2e8bac07947855369fe2d77642dfc870" + }, + { + "from_contentnode_id": "2e8bac07947855369fe2d77642dfc870", + "id": 2, + "to_contentnode_id": "32a941fb77c2576e8f6b294cde4c3b0c" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "6199dde695db4ee4ab392222d5af1e5c", + "contenttag_id": "1d21d6cf40554b68977366f8218248ae", + "id": 1 + }, + { + "contentnode_id": "6199dde695db4ee4ab392222d5af1e5c", + "contenttag_id": "77b57a14a1f0466bb27ea7de8ff468be", + "id": 2 + }, + { + "contentnode_id": "6199dde695db4ee4ab392222d5af1e5c", + "contenttag_id": "222455c2cc484298b1501a13e1c7eb5c", + "id": 3 + }, + { + "contentnode_id": "32a941fb77c2576e8f6b294cde4c3b0c", + "contenttag_id": "1d21d6cf40554b68977366f8218248ae", + "id": 4 + }, + { + "contentnode_id": "2e8bac07947855369fe2d77642dfc870", + "contenttag_id": "77b57a14a1f0466bb27ea7de8ff468be", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "1d21d6cf40554b68977366f8218248ae", + "tag_name": "tag_1" + }, + { + "id": "77b57a14a1f0466bb27ea7de8ff468be", + "tag_name": "tag_2" + }, + { + "id": "222455c2cc484298b1501a13e1c7eb5c", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "32a941fb77c2576e8f6b294cde4c3b0c", + "id": "cd02925716f54a79acdad30581a5958f", + "lang_id": "en", + "local_file_id": "8d39dd7eef115ea6975446ef4082951f", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "32a941fb77c2576e8f6b294cde4c3b0c", + "id": "aa54a11fa86847aca4fe75d112939389", + "lang_id": "en", + "local_file_id": "e1671797c52e15f763380b45e841ec32", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "32a941fb77c2576e8f6b294cde4c3b0c", + "id": "35d92de2e4b24a15b534e275acdc033a", + "lang_id": null, + "local_file_id": "68b329da9893e34099c7d8ad5cb9c940", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "32a941fb77c2576e8f6b294cde4c3b0c", + "id": "b5366fbe097f43acb2156da29a7c589c", + "lang_id": null, + "local_file_id": "44f2c50b838f92970d2c11e2fa98bc7d", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "1fe38e5af42f42678f8db66a18f8267a", + "id": "9fde030e11fe4a1cb6626ee9c44b0777", + "lang_id": null, + "local_file_id": "0bcef9c45bd8a48eda1b26eb0c61c869", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "2b6926ed22025518a8b9da91745b51d3", + "id": "2a9e212e60ac493aa6664db417dd5665", + "lang_id": "3", + "local_file_id": "2db95e8e1a9267b7a1188556b2013b33", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "2b6926ed22025518a8b9da91745b51d3", + "id": "462fc5458e7a46ff9fd7f7b522b4710a", + "lang_id": null, + "local_file_id": "cd25041f9f36811b04ab3015805fe816", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "4d0c890de9b65d6880ccfa527800e0f4", + "id": "443ab064188440438ac50c132a9444c4", + "lang_id": null, + "local_file_id": "8ce4b16b22b58894aa86c421e8759df3", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "4d0c890de9b65d6880ccfa527800e0f4", + "id": "73595f91699749798449a3d40d4b5e2e", + "lang_id": null, + "local_file_id": "ade7a0dcf4ddc0673ed48b70a4a340d6", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "b391bfeec8a458f89f013cf1ca9cf33a", + "id": "1b878a61b780f9e381da34b21515267e", + "lang_id": null, + "local_file_id": "01957a44986782af43630bedbf3260c3", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "gA==", + "available": false, + "extension": "mp4", + "file_size": 1, + "id": "8d39dd7eef115ea6975446ef4082951f" + }, + { + "_content": "ZQ==", + "available": false, + "extension": "mp4", + "file_size": 1, + "id": "e1671797c52e15f763380b45e841ec32" + }, + { + "_content": "Cg==", + "available": false, + "extension": "vtt", + "file_size": 1, + "id": "68b329da9893e34099c7d8ad5cb9c940" + }, + { + "_content": "9g==", + "available": false, + "extension": "png", + "file_size": 1, + "id": "44f2c50b838f92970d2c11e2fa98bc7d" + }, + { + "_content": "gQ==", + "available": false, + "extension": "jpeg", + "file_size": 1, + "id": "0bcef9c45bd8a48eda1b26eb0c61c869" + }, + { + "_content": "JQ==", + "available": false, + "extension": "zip", + "file_size": 1, + "id": "2db95e8e1a9267b7a1188556b2013b33" + }, + { + "_content": "gQ==", + "available": false, + "extension": "jpeg", + "file_size": 1, + "id": "cd25041f9f36811b04ab3015805fe816" + }, + { + "_content": "aw==", + "available": false, + "extension": "epub", + "file_size": 1, + "id": "8ce4b16b22b58894aa86c421e8759df3" + }, + { + "_content": "9Q==", + "available": false, + "extension": "png", + "file_size": 1, + "id": "ade7a0dcf4ddc0673ed48b70a4a340d6" + }, + { + "_content": "WQ==", + "available": false, + "extension": "mp3", + "file_size": 1, + "id": "01957a44986782af43630bedbf3260c3" + } + ] +} diff --git a/kolibri_explore_plugin/test/channels/dc4f1c59c6c34584b806004e77362e31.json b/kolibri_explore_plugin/test/channels/dc4f1c59c6c34584b806004e77362e31.json new file mode 100644 index 000000000..95a44a3fa --- /dev/null +++ b/kolibri_explore_plugin/test/channels/dc4f1c59c6c34584b806004e77362e31.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "dc4f1c59c6c34584b806004e77362e31", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "dc4f1c59c6c34584b806004e77362e31", + "tagline": null, + "thumbnail": "data:image/jpg;base64,fCnaEM+ylzYD4hFf3KpFUnHZmaa3KhK8rOGCiWV7", + "version": 2 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dc4f1c59c6c34584b806004e77362e31", + "coach_content": false, + "content_id": "dc4f1c59c6c34584b806004e77362e31", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "dc4f1c59c6c34584b806004e77362e31", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dc4f1c59c6c34584b806004e77362e31", + "coach_content": false, + "content_id": "a8ba4031198a49fd88563bf8436d1f83", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "61bbc2b4385e4f508c9f3c361526ef36", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "dc4f1c59c6c34584b806004e77362e31", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dc4f1c59c6c34584b806004e77362e31", + "coach_content": false, + "content_id": "3fb74f04b30c4f66b86b30688bf651fb", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "1c0d537c9bb74afaacdde495a3f73e57", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "dc4f1c59c6c34584b806004e77362e31", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dc4f1c59c6c34584b806004e77362e31", + "coach_content": false, + "content_id": "0962a77f47f641d186c1d37da7874482", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "c43691cde6914aa9b4e58a8d025514a0", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "1c0d537c9bb74afaacdde495a3f73e57", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dc4f1c59c6c34584b806004e77362e31", + "coach_content": false, + "content_id": "0f60b02bfe7c4b9482208ec5806ef8ee", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "e764e7ad06124476855b34d7fc80bb73", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "1c0d537c9bb74afaacdde495a3f73e57", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dc4f1c59c6c34584b806004e77362e31", + "coach_content": false, + "content_id": "c2d4c138b4684ce6b725736d1ae72a7b", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "9f5c5f52beaa4d85817db59f1ff1fd84", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "1c0d537c9bb74afaacdde495a3f73e57", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "61bbc2b4385e4f508c9f3c361526ef36", + "id": 1, + "to_contentnode_id": "dc4f1c59c6c34584b806004e77362e31" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "61bbc2b4385e4f508c9f3c361526ef36", + "id": 1, + "to_contentnode_id": "1c0d537c9bb74afaacdde495a3f73e57" + }, + { + "from_contentnode_id": "1c0d537c9bb74afaacdde495a3f73e57", + "id": 2, + "to_contentnode_id": "61bbc2b4385e4f508c9f3c361526ef36" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "dc4f1c59c6c34584b806004e77362e31", + "contenttag_id": "a39b960c2ea14f4c919434ddfbc90875", + "id": 1 + }, + { + "contentnode_id": "dc4f1c59c6c34584b806004e77362e31", + "contenttag_id": "f297b4c6121f49b1a6765dcb30c20a95", + "id": 2 + }, + { + "contentnode_id": "dc4f1c59c6c34584b806004e77362e31", + "contenttag_id": "9780cd8a05084ee096a7cd61e99a8192", + "id": 3 + }, + { + "contentnode_id": "61bbc2b4385e4f508c9f3c361526ef36", + "contenttag_id": "a39b960c2ea14f4c919434ddfbc90875", + "id": 4 + }, + { + "contentnode_id": "1c0d537c9bb74afaacdde495a3f73e57", + "contenttag_id": "f297b4c6121f49b1a6765dcb30c20a95", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "a39b960c2ea14f4c919434ddfbc90875", + "tag_name": "tag_1" + }, + { + "id": "f297b4c6121f49b1a6765dcb30c20a95", + "tag_name": "tag_2" + }, + { + "id": "9780cd8a05084ee096a7cd61e99a8192", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "61bbc2b4385e4f508c9f3c361526ef36", + "id": "64e09563cf414b798c27731de08e3af1", + "lang_id": "en", + "local_file_id": "1c807c06f671da4031a9f8b200890104", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "61bbc2b4385e4f508c9f3c361526ef36", + "id": "8c0d56e14fa7441b873c95612f20294e", + "lang_id": "en", + "local_file_id": "68e8c14917460f1eafc0e6c1d79edea0", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "61bbc2b4385e4f508c9f3c361526ef36", + "id": "2319488d014d4d36a7ab680e17b14a11", + "lang_id": null, + "local_file_id": "5dbc98dcc983a70728bd082d1a47546e", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "61bbc2b4385e4f508c9f3c361526ef36", + "id": "a98841cbff9f42d7b19baf1c86870743", + "lang_id": null, + "local_file_id": "f643bc161b4d655aacd6de14d113988a", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "1c0d537c9bb74afaacdde495a3f73e57", + "id": "ede1ef131bc2448e8eec454ab480d807", + "lang_id": null, + "local_file_id": "7fc56270e7a70fa81a5935b72eacbe29", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "c43691cde6914aa9b4e58a8d025514a0", + "id": "130c29e4cdaa4019a3f5a155bdd9a921", + "lang_id": "3", + "local_file_id": "2f1682e88639f7f44dbd726dec37a9cd", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "c43691cde6914aa9b4e58a8d025514a0", + "id": "cfec25dfadb24d0a9cc07b66a9feeedc", + "lang_id": null, + "local_file_id": "a6b2379044ead68f863db1fa77416d6a", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "e764e7ad06124476855b34d7fc80bb73", + "id": "3f50fd2ce0fb4ef5955b459daddf2c08", + "lang_id": null, + "local_file_id": "45e6f03b83fccbdcdaad1901ca94a59f", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "e764e7ad06124476855b34d7fc80bb73", + "id": "ac1e2a9360ee47fb98cecbea37827088", + "lang_id": null, + "local_file_id": "b2a5284de485276d99cbd6aad39162e5", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "9f5c5f52beaa4d85817db59f1ff1fd84", + "id": "182d4760096c4824890c8d328d4f3f45", + "lang_id": null, + "local_file_id": "1aaabe0ed75e74bc30a4d7004df6990d", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "r5LZkdeUeTkeQkAB5uZi", + "available": false, + "extension": "mp4", + "file_size": 15, + "id": "1c807c06f671da4031a9f8b200890104" + }, + { + "_content": "pR57RqK1N1DUWSIYZZiqsqOHIQ==", + "available": false, + "extension": "mp4", + "file_size": 19, + "id": "68e8c14917460f1eafc0e6c1d79edea0" + }, + { + "_content": "Uw==", + "available": false, + "extension": "vtt", + "file_size": 1, + "id": "5dbc98dcc983a70728bd082d1a47546e" + }, + { + "_content": "GqvmDv9Jc9c6P7+eUBIMDEpbf47DbucMODA6jbo=", + "available": false, + "extension": "png", + "file_size": 29, + "id": "f643bc161b4d655aacd6de14d113988a" + }, + { + "_content": "QQ==", + "available": false, + "extension": "jpeg", + "file_size": 1, + "id": "7fc56270e7a70fa81a5935b72eacbe29" + }, + { + "_content": "2mEnWOWhhC7lD6TJWw6Th5W8", + "available": false, + "extension": "zip", + "file_size": 18, + "id": "2f1682e88639f7f44dbd726dec37a9cd" + }, + { + "_content": "dhEMMMLRQk6yie85riIK753Mb9Bv0CYCpHY=", + "available": false, + "extension": "jpeg", + "file_size": 26, + "id": "a6b2379044ead68f863db1fa77416d6a" + }, + { + "_content": "MkvTgZsQjBROgz2IL+EuzQ==", + "available": false, + "extension": "epub", + "file_size": 16, + "id": "45e6f03b83fccbdcdaad1901ca94a59f" + }, + { + "_content": "rLdBzlWuYMkQHnUQxy1CJA2ZNKCPMjwfxF0=", + "available": false, + "extension": "png", + "file_size": 26, + "id": "b2a5284de485276d99cbd6aad39162e5" + }, + { + "_content": "bmrECO1n4WfgL+2P+tKcm32tF7B6xg==", + "available": false, + "extension": "mp3", + "file_size": 22, + "id": "1aaabe0ed75e74bc30a4d7004df6990d" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/channels/dd28be6f502c42b2a1d96396a930a446.json b/kolibri_explore_plugin/test/channels/dd28be6f502c42b2a1d96396a930a446.json new file mode 100644 index 000000000..ccab42f51 --- /dev/null +++ b/kolibri_explore_plugin/test/channels/dd28be6f502c42b2a1d96396a930a446.json @@ -0,0 +1,449 @@ +{ + "content_channelmetadata": [ + { + "author": "eli", + "description": "test data", + "id": "dd28be6f502c42b2a1d96396a930a446", + "last_updated": null, + "min_schema_version": "1", + "name": "testing", + "root_id": "dd28be6f502c42b2a1d96396a930a446", + "tagline": null, + "thumbnail": "data:image/jpg;base64,At2R8XaTpFFM7/d9vyp8ToE9JcVE8HVl7YSZI6X1", + "version": 3 + } + ], + "content_contentnode": [ + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dd28be6f502c42b2a1d96396a930a446", + "coach_content": false, + "content_id": "dd28be6f502c42b2a1d96396a930a446", + "description": "balbla1", + "duration": null, + "grade_levels": null, + "id": "dd28be6f502c42b2a1d96396a930a446", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 0, + "lft": 1, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": null, + "resource_types": null, + "rght": 12, + "sort_order": null, + "title": "root", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dd28be6f502c42b2a1d96396a930a446", + "coach_content": false, + "content_id": "01edc8df7d0c45efa37618351e871474", + "description": "balbla2", + "duration": null, + "grade_levels": null, + "id": "dc41def0c52249c6a090ad11cf81ac46", + "kind": "video", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 2, + "license_description": null, + "license_name": "WTFPL", + "license_owner": "", + "options": "{}", + "parent_id": "dd28be6f502c42b2a1d96396a930a446", + "resource_types": null, + "rght": 3, + "sort_order": null, + "title": "c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dd28be6f502c42b2a1d96396a930a446", + "coach_content": false, + "content_id": "41c54c6a044246a58c7936ca57dd90a2", + "description": "balbla3", + "duration": null, + "grade_levels": null, + "id": "8878ff9c9bb54b80aee165f5e22d8937", + "kind": "topic", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 1, + "lft": 4, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "dd28be6f502c42b2a1d96396a930a446", + "resource_types": null, + "rght": 11, + "sort_order": null, + "title": "c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dd28be6f502c42b2a1d96396a930a446", + "coach_content": false, + "content_id": "8633da1443624229979582defc8da1d9", + "description": "balbla4", + "duration": null, + "grade_levels": null, + "id": "6d0fdc33b4174f998559ab6b9683ef2f", + "kind": "html5_zip", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 5, + "license_description": null, + "license_name": "CC", + "license_owner": "", + "options": "{}", + "parent_id": "8878ff9c9bb54b80aee165f5e22d8937", + "resource_types": null, + "rght": 6, + "sort_order": null, + "title": "c2c1", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dd28be6f502c42b2a1d96396a930a446", + "coach_content": false, + "content_id": "1e844cf10f9b45b3957723ad19a2fc58", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "5881096609164e909cdaf3f8caba60e1", + "kind": "document", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 7, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "8878ff9c9bb54b80aee165f5e22d8937", + "resource_types": null, + "rght": 8, + "sort_order": null, + "title": "c2c2", + "tree_id": 1 + }, + { + "accessibility_labels": null, + "author": "", + "available": false, + "categories": null, + "channel_id": "dd28be6f502c42b2a1d96396a930a446", + "coach_content": false, + "content_id": "f3abcfb61ffe41b08638d95944197249", + "description": "balbla5", + "duration": null, + "grade_levels": null, + "id": "33b68446f85746b6babfd77da6d7db94", + "kind": "audio", + "lang_id": null, + "learner_needs": null, + "learning_activities": null, + "level": 2, + "lft": 9, + "license_description": null, + "license_name": "GNU", + "license_owner": "", + "options": "{}", + "parent_id": "8878ff9c9bb54b80aee165f5e22d8937", + "resource_types": null, + "rght": 10, + "sort_order": null, + "title": "c2c3", + "tree_id": 1 + } + ], + "content_contentnode_has_prerequisite": [ + { + "from_contentnode_id": "dc41def0c52249c6a090ad11cf81ac46", + "id": 1, + "to_contentnode_id": "dd28be6f502c42b2a1d96396a930a446" + } + ], + "content_contentnode_related": [ + { + "from_contentnode_id": "dc41def0c52249c6a090ad11cf81ac46", + "id": 1, + "to_contentnode_id": "8878ff9c9bb54b80aee165f5e22d8937" + }, + { + "from_contentnode_id": "8878ff9c9bb54b80aee165f5e22d8937", + "id": 2, + "to_contentnode_id": "dc41def0c52249c6a090ad11cf81ac46" + } + ], + "content_contentnode_tags": [ + { + "contentnode_id": "dd28be6f502c42b2a1d96396a930a446", + "contenttag_id": "04d32bc78d254950bb870658c2b10c27", + "id": 1 + }, + { + "contentnode_id": "dd28be6f502c42b2a1d96396a930a446", + "contenttag_id": "6aff2fe9a4f7444e9836e664d8b0ddee", + "id": 2 + }, + { + "contentnode_id": "dd28be6f502c42b2a1d96396a930a446", + "contenttag_id": "b8bec94d25824f4db89f1d335189c7a7", + "id": 3 + }, + { + "contentnode_id": "dc41def0c52249c6a090ad11cf81ac46", + "contenttag_id": "04d32bc78d254950bb870658c2b10c27", + "id": 4 + }, + { + "contentnode_id": "8878ff9c9bb54b80aee165f5e22d8937", + "contenttag_id": "6aff2fe9a4f7444e9836e664d8b0ddee", + "id": 5 + } + ], + "content_contenttag": [ + { + "id": "04d32bc78d254950bb870658c2b10c27", + "tag_name": "tag_1" + }, + { + "id": "6aff2fe9a4f7444e9836e664d8b0ddee", + "tag_name": "tag_2" + }, + { + "id": "b8bec94d25824f4db89f1d335189c7a7", + "tag_name": "tag_3" + } + ], + "content_file": [ + { + "contentnode_id": "dc41def0c52249c6a090ad11cf81ac46", + "id": "8a0b3627495e4e9babc4e2e3bfcdbe0e", + "lang_id": "en", + "local_file_id": "1947eaa4611bb168ca3c47a289e82956", + "preset": "high_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "dc41def0c52249c6a090ad11cf81ac46", + "id": "d94d3672aa99413280954c0645a9ddbf", + "lang_id": "en", + "local_file_id": "4bc7684f61eb1e47a4be0819427a2c54", + "preset": "low_res_video", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "dc41def0c52249c6a090ad11cf81ac46", + "id": "d46b0de5e00349feb709dc1031a9c82b", + "lang_id": null, + "local_file_id": "cc4863916b07792d9ab12bc5d73e2f3e", + "preset": "video_subtitle", + "priority": null, + "supplementary": true, + "thumbnail": false + }, + { + "contentnode_id": "dc41def0c52249c6a090ad11cf81ac46", + "id": "23165ef1784f4a2e9b3dd04176602cc6", + "lang_id": null, + "local_file_id": "77e63a0d99a94f1750d5b467744932d6", + "preset": "video_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "8878ff9c9bb54b80aee165f5e22d8937", + "id": "ad1fa2887acb40119dcf082c7f8111bb", + "lang_id": null, + "local_file_id": "45fc932212c09b114b139edf0c4da17b", + "preset": "topic_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "6d0fdc33b4174f998559ab6b9683ef2f", + "id": "197a3ddf14dd49c4b73b87dc903cc1ab", + "lang_id": "3", + "local_file_id": "73578f7d5d0c56901e43ddb54e5b9dd5", + "preset": "html5_zip", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "6d0fdc33b4174f998559ab6b9683ef2f", + "id": "8d6b7ed061f34254891a1f662c42f9b3", + "lang_id": null, + "local_file_id": "1f0b5c83a0903b45f22b768559d493c1", + "preset": "html5_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "5881096609164e909cdaf3f8caba60e1", + "id": "fd2e22f379d9444daa031a677ee36bc2", + "lang_id": null, + "local_file_id": "2fc1e8b532b91562e8cfa44c0bbfe0af", + "preset": "document", + "priority": null, + "supplementary": false, + "thumbnail": false + }, + { + "contentnode_id": "5881096609164e909cdaf3f8caba60e1", + "id": "53c3833825f241a5b62cc54f70b368b6", + "lang_id": null, + "local_file_id": "e25e463c421c03b39f89eefe1d668f68", + "preset": "document_thumbnail", + "priority": null, + "supplementary": false, + "thumbnail": true + }, + { + "contentnode_id": "33b68446f85746b6babfd77da6d7db94", + "id": "144282cd14ab4334a9575a0a9d1327e3", + "lang_id": null, + "local_file_id": "017ae680d8dd5baa65ac35b6b5af7712", + "preset": "audio", + "priority": null, + "supplementary": false, + "thumbnail": false + } + ], + "content_language": [ + { + "id": "en", + "lang_code": "en", + "lang_direction": "ltr", + "lang_name": "English-Test", + "lang_subcode": "01" + }, + { + "id": "zh", + "lang_code": "zh", + "lang_direction": "ltr", + "lang_name": "Chinese-Test", + "lang_subcode": "02" + }, + { + "id": "es", + "lang_code": "es", + "lang_direction": "ltr", + "lang_name": "Spanish-Test", + "lang_subcode": "03" + } + ], + "content_localfile": [ + { + "_content": "5zZLXuS3sEvk5VQG7tKHV+j9", + "available": false, + "extension": "mp4", + "file_size": 18, + "id": "1947eaa4611bb168ca3c47a289e82956" + }, + { + "_content": "jTAkYYg=", + "available": false, + "extension": "mp4", + "file_size": 5, + "id": "4bc7684f61eb1e47a4be0819427a2c54" + }, + { + "_content": "XiqztbLV6XLX84NK", + "available": false, + "extension": "vtt", + "file_size": 12, + "id": "cc4863916b07792d9ab12bc5d73e2f3e" + }, + { + "_content": "nl5+DZ0MdA==", + "available": false, + "extension": "png", + "file_size": 7, + "id": "77e63a0d99a94f1750d5b467744932d6" + }, + { + "_content": "MiTcYReTY6DMfot2DLwM8lk=", + "available": false, + "extension": "jpeg", + "file_size": 17, + "id": "45fc932212c09b114b139edf0c4da17b" + }, + { + "_content": "8NiE+w0secYNlbHLc6zF8u9gCjFH3nDhahmsQEY=", + "available": false, + "extension": "zip", + "file_size": 29, + "id": "73578f7d5d0c56901e43ddb54e5b9dd5" + }, + { + "_content": "rk1qswdasRqLm34T", + "available": false, + "extension": "jpeg", + "file_size": 12, + "id": "1f0b5c83a0903b45f22b768559d493c1" + }, + { + "_content": "HIecHRbE0104LVslbF0LE6J13p8uEhvX5UIQ4JY=", + "available": false, + "extension": "epub", + "file_size": 29, + "id": "2fc1e8b532b91562e8cfa44c0bbfe0af" + }, + { + "_content": "ZDj6Kw0L/JL7eoM=", + "available": false, + "extension": "png", + "file_size": 11, + "id": "e25e463c421c03b39f89eefe1d668f68" + }, + { + "_content": "itI2+9EeGVYh3V2l+d7v348ZSVo28w==", + "available": false, + "extension": "mp3", + "file_size": 22, + "id": "017ae680d8dd5baa65ac35b6b5af7712" + } + ] +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/collections/README.md b/kolibri_explore_plugin/test/collections/README.md new file mode 100644 index 000000000..82cce690b --- /dev/null +++ b/kolibri_explore_plugin/test/collections/README.md @@ -0,0 +1,23 @@ +# Test collections data + +Each JSON file provides a test pack from endless-key-collections. Each +pack contains the following: + +* Two channels +* Two included nodes per channel. The nodes are always the top level + video and the document within the channel's subtopic. +* Each included node has a single tag. +* The first channel root node is tagged as a featured channel. + +## Generating collections packs + +The `create_collection_pack.py` script can be used to generate a new +collection pack. It requires the pack name, pack version and 2 channel +IDs. For consistency, new channels should be created and used so that +each test pack uses independent channels. + +``` +./scripts/create_channeldb_json.py +./scripts/create_channeldb_json.py +./scripts/create_collection_pack.py foo 0001 +``` diff --git a/kolibri_explore_plugin/test/collections/artist-0001.json b/kolibri_explore_plugin/test/collections/artist-0001.json new file mode 100644 index 000000000..3bdecf6ab --- /dev/null +++ b/kolibri_explore_plugin/test/collections/artist-0001.json @@ -0,0 +1,59 @@ +{ + "channels": [ + { + "id": "1af9e59af51f4c27a145433b83e3cea2", + "version": 4, + "include_node_ids": [ + "305cce826f5645abb072b82961048ae4", + "2e9f1c47b00847ab859f27fa216adcce" + ] + }, + { + "id": "1d11cf118c3d4691907a6abb880b7c20", + "version": 3, + "include_node_ids": [ + "3faff591666c475eb9495f962e36d95a", + "89bfe3ddf45d4d3e864e2b71a08a99f4" + ] + } + ], + "metadata": { + "title": "Artist", + "subtitle": "0001", + "description": "artist", + "required_gigabytes": 0, + "tagged_node_ids": [ + { + "node_id": "1af9e59af51f4c27a145433b83e3cea2", + "tags": [ + "featured-channel" + ] + }, + { + "node_id": "305cce826f5645abb072b82961048ae4", + "tags": [ + "highlight" + ] + }, + { + "node_id": "2e9f1c47b00847ab859f27fa216adcce", + "tags": [ + "highlight" + ] + }, + { + "node_id": "3faff591666c475eb9495f962e36d95a", + "tags": [ + "highlight" + ] + }, + { + "node_id": "89bfe3ddf45d4d3e864e2b71a08a99f4", + "tags": [ + "highlight" + ] + } + ] + }, + "channel_list_hash": "" +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/collections/athlete-0001.json b/kolibri_explore_plugin/test/collections/athlete-0001.json new file mode 100644 index 000000000..80f9b2c0c --- /dev/null +++ b/kolibri_explore_plugin/test/collections/athlete-0001.json @@ -0,0 +1,59 @@ +{ + "channels": [ + { + "id": "411af6738f164071b150843b973c3bc1", + "version": 3, + "include_node_ids": [ + "bf8ced6d3b1b43c4a8fc66f56379655d", + "e129938827094367a9868108f0818783" + ] + }, + { + "id": "4350f8ed80dd40dfbd4ed3c9732d449d", + "version": 4, + "include_node_ids": [ + "e90d9e99c6d9485aace01ffe434f1009", + "7db0f6eb5e084a8d8b8dbf823dda7de6" + ] + } + ], + "metadata": { + "title": "Athlete", + "subtitle": "0001", + "description": "athlete", + "required_gigabytes": 0, + "tagged_node_ids": [ + { + "node_id": "411af6738f164071b150843b973c3bc1", + "tags": [ + "featured-channel" + ] + }, + { + "node_id": "bf8ced6d3b1b43c4a8fc66f56379655d", + "tags": [ + "highlight" + ] + }, + { + "node_id": "e129938827094367a9868108f0818783", + "tags": [ + "highlight" + ] + }, + { + "node_id": "e90d9e99c6d9485aace01ffe434f1009", + "tags": [ + "highlight" + ] + }, + { + "node_id": "7db0f6eb5e084a8d8b8dbf823dda7de6", + "tags": [ + "highlight" + ] + } + ] + }, + "channel_list_hash": "" +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/collections/curious-0001.json b/kolibri_explore_plugin/test/collections/curious-0001.json new file mode 100644 index 000000000..fbc60e53a --- /dev/null +++ b/kolibri_explore_plugin/test/collections/curious-0001.json @@ -0,0 +1,59 @@ +{ + "channels": [ + { + "id": "56048757b6644208a639fbdb03510ab8", + "version": 3, + "include_node_ids": [ + "5b45ba733da84be4b348bfa3e57cdbdc", + "3d78511512c44097baeedc32d972e5eb" + ] + }, + { + "id": "5e7db57c21df4230bad6e8b365754632", + "version": 4, + "include_node_ids": [ + "20945f2430894c1baf64aa02dbf9775c", + "2ebc745323324cfaad91674b42f96ee3" + ] + } + ], + "metadata": { + "title": "Curious", + "subtitle": "0001", + "description": "curious", + "required_gigabytes": 0, + "tagged_node_ids": [ + { + "node_id": "56048757b6644208a639fbdb03510ab8", + "tags": [ + "featured-channel" + ] + }, + { + "node_id": "5b45ba733da84be4b348bfa3e57cdbdc", + "tags": [ + "highlight" + ] + }, + { + "node_id": "3d78511512c44097baeedc32d972e5eb", + "tags": [ + "highlight" + ] + }, + { + "node_id": "20945f2430894c1baf64aa02dbf9775c", + "tags": [ + "highlight" + ] + }, + { + "node_id": "2ebc745323324cfaad91674b42f96ee3", + "tags": [ + "highlight" + ] + } + ] + }, + "channel_list_hash": "" +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/collections/explorer-0001.json b/kolibri_explore_plugin/test/collections/explorer-0001.json new file mode 100644 index 000000000..61db913be --- /dev/null +++ b/kolibri_explore_plugin/test/collections/explorer-0001.json @@ -0,0 +1,59 @@ +{ + "channels": [ + { + "id": "64fa38415b4849629d027069b4110bab", + "version": 2, + "include_node_ids": [ + "9ec8e38f7eed4744af532c3757a742d3", + "d077718ec620479fbd320d4b06b76658" + ] + }, + { + "id": "65a2964ce74943778bdabb348caebb0d", + "version": 4, + "include_node_ids": [ + "48b2b950bdc747ceb6fe60ecd8436c91", + "b828889127344e9fba277dc6b3b89ae4" + ] + } + ], + "metadata": { + "title": "Explorer", + "subtitle": "0001", + "description": "explorer", + "required_gigabytes": 0, + "tagged_node_ids": [ + { + "node_id": "64fa38415b4849629d027069b4110bab", + "tags": [ + "featured-channel" + ] + }, + { + "node_id": "9ec8e38f7eed4744af532c3757a742d3", + "tags": [ + "highlight" + ] + }, + { + "node_id": "d077718ec620479fbd320d4b06b76658", + "tags": [ + "highlight" + ] + }, + { + "node_id": "48b2b950bdc747ceb6fe60ecd8436c91", + "tags": [ + "highlight" + ] + }, + { + "node_id": "b828889127344e9fba277dc6b3b89ae4", + "tags": [ + "highlight" + ] + } + ] + }, + "channel_list_hash": "" +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/collections/extras-0001.json b/kolibri_explore_plugin/test/collections/extras-0001.json new file mode 100644 index 000000000..2b0d14367 --- /dev/null +++ b/kolibri_explore_plugin/test/collections/extras-0001.json @@ -0,0 +1,59 @@ +{ + "channels": [ + { + "id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "version": 1, + "include_node_ids": [ + "e73c0cba43a945f7a79b55d467e3fbef", + "196dcbd78fa34a468e1b7c7416ee0242" + ] + }, + { + "id": "817c628f90db40f2b489191c82e203c6", + "version": 1, + "include_node_ids": [ + "2624218309a946428b4893c9d529f705", + "40ceecf41e10437aa299b43885f6c01b" + ] + } + ], + "metadata": { + "title": "Extras", + "subtitle": "0001", + "description": "extras", + "required_gigabytes": 0, + "tagged_node_ids": [ + { + "node_id": "6aba580c1c7b41ebaac64e5ef7b1cb08", + "tags": [ + "featured-channel" + ] + }, + { + "node_id": "e73c0cba43a945f7a79b55d467e3fbef", + "tags": [ + "highlight" + ] + }, + { + "node_id": "196dcbd78fa34a468e1b7c7416ee0242", + "tags": [ + "highlight" + ] + }, + { + "node_id": "2624218309a946428b4893c9d529f705", + "tags": [ + "highlight" + ] + }, + { + "node_id": "40ceecf41e10437aa299b43885f6c01b", + "tags": [ + "highlight" + ] + } + ] + }, + "channel_list_hash": "" +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/collections/inventor-0001.json b/kolibri_explore_plugin/test/collections/inventor-0001.json new file mode 100644 index 000000000..0bbcfd3c3 --- /dev/null +++ b/kolibri_explore_plugin/test/collections/inventor-0001.json @@ -0,0 +1,59 @@ +{ + "channels": [ + { + "id": "89c858dc2dd24512b2eff27ac12d3d4a", + "version": 1, + "include_node_ids": [ + "9570292af3334e4f8286ed89c6e08df4", + "f13d86bd78834071b81709c5455c3653" + ] + }, + { + "id": "9c2e07c1bf8d4f4299e83592eb034020", + "version": 3, + "include_node_ids": [ + "035614fb9c614e21871fd271ec8d1e18", + "f6aa860d9f1c421fa520bf2893dca95d" + ] + } + ], + "metadata": { + "title": "Inventor", + "subtitle": "0001", + "description": "inventor", + "required_gigabytes": 0, + "tagged_node_ids": [ + { + "node_id": "89c858dc2dd24512b2eff27ac12d3d4a", + "tags": [ + "featured-channel" + ] + }, + { + "node_id": "9570292af3334e4f8286ed89c6e08df4", + "tags": [ + "highlight" + ] + }, + { + "node_id": "f13d86bd78834071b81709c5455c3653", + "tags": [ + "highlight" + ] + }, + { + "node_id": "035614fb9c614e21871fd271ec8d1e18", + "tags": [ + "highlight" + ] + }, + { + "node_id": "f6aa860d9f1c421fa520bf2893dca95d", + "tags": [ + "highlight" + ] + } + ] + }, + "channel_list_hash": "" +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/collections/pack.json.template b/kolibri_explore_plugin/test/collections/pack.json.template new file mode 100644 index 000000000..2e67a1ecc --- /dev/null +++ b/kolibri_explore_plugin/test/collections/pack.json.template @@ -0,0 +1,59 @@ +{ + "channels": [ + { + "id": "", + "version": 0, + "include_node_ids": [ + "", + "" + ] + }, + { + "id": "", + "version": 0, + "include_node_ids": [ + "", + "" + ] + } + ], + "metadata": { + "title": "", + "subtitle": "", + "description": "", + "required_gigabytes": 0, + "tagged_node_ids": [ + { + "node_id": "", + "tags": [ + "featured-channel" + ] + }, + { + "node_id": "", + "tags": [ + "highlight" + ] + }, + { + "node_id": "", + "tags": [ + "highlight" + ] + }, + { + "node_id": "", + "tags": [ + "highlight" + ] + }, + { + "node_id": "", + "tags": [ + "highlight" + ] + } + ] + }, + "channel_list_hash": "" +} diff --git a/kolibri_explore_plugin/test/collections/scientist-0001.json b/kolibri_explore_plugin/test/collections/scientist-0001.json new file mode 100644 index 000000000..2e06b06a4 --- /dev/null +++ b/kolibri_explore_plugin/test/collections/scientist-0001.json @@ -0,0 +1,59 @@ +{ + "channels": [ + { + "id": "b51baf46133045e3bce4d2d872a8f71d", + "version": 1, + "include_node_ids": [ + "5a24503255ce43d98ebcb25d2b60f024", + "91a1bfc0ede544979f861909b7862537" + ] + }, + { + "id": "b77bba2e4b884813b8e22d63b964fb73", + "version": 3, + "include_node_ids": [ + "05755d03082c4444a3b0fef1e72d7219", + "7c251a8e820545e49fbe21b53194e433" + ] + } + ], + "metadata": { + "title": "Scientist", + "subtitle": "0001", + "description": "scientist", + "required_gigabytes": 0, + "tagged_node_ids": [ + { + "node_id": "b51baf46133045e3bce4d2d872a8f71d", + "tags": [ + "featured-channel" + ] + }, + { + "node_id": "5a24503255ce43d98ebcb25d2b60f024", + "tags": [ + "highlight" + ] + }, + { + "node_id": "91a1bfc0ede544979f861909b7862537", + "tags": [ + "highlight" + ] + }, + { + "node_id": "05755d03082c4444a3b0fef1e72d7219", + "tags": [ + "highlight" + ] + }, + { + "node_id": "7c251a8e820545e49fbe21b53194e433", + "tags": [ + "highlight" + ] + } + ] + }, + "channel_list_hash": "" +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/collections/spanish-0001.json b/kolibri_explore_plugin/test/collections/spanish-0001.json new file mode 100644 index 000000000..e95f50963 --- /dev/null +++ b/kolibri_explore_plugin/test/collections/spanish-0001.json @@ -0,0 +1,59 @@ +{ + "channels": [ + { + "id": "be6a104a25d44c5682075c54f268eb43", + "version": 2, + "include_node_ids": [ + "91c4871f3b924c2fbfcdccbead2f11da", + "c6dd8fb6b5c54da2968117e9b27a20cf" + ] + }, + { + "id": "dabc98a59edb40c0b4722d5e3df48bbc", + "version": 2, + "include_node_ids": [ + "8ac97da8b5844a2ea711ea2d983590c2", + "b14211a57b434fc5a1d068c56046ee57" + ] + } + ], + "metadata": { + "title": "Spanish", + "subtitle": "0001", + "description": "spanish", + "required_gigabytes": 0, + "tagged_node_ids": [ + { + "node_id": "be6a104a25d44c5682075c54f268eb43", + "tags": [ + "featured-channel" + ] + }, + { + "node_id": "91c4871f3b924c2fbfcdccbead2f11da", + "tags": [ + "highlight" + ] + }, + { + "node_id": "c6dd8fb6b5c54da2968117e9b27a20cf", + "tags": [ + "highlight" + ] + }, + { + "node_id": "8ac97da8b5844a2ea711ea2d983590c2", + "tags": [ + "highlight" + ] + }, + { + "node_id": "b14211a57b434fc5a1d068c56046ee57", + "tags": [ + "highlight" + ] + } + ] + }, + "channel_list_hash": "" +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/collections/spanish-extras-0001.json b/kolibri_explore_plugin/test/collections/spanish-extras-0001.json new file mode 100644 index 000000000..9ce48738b --- /dev/null +++ b/kolibri_explore_plugin/test/collections/spanish-extras-0001.json @@ -0,0 +1,59 @@ +{ + "channels": [ + { + "id": "dc4f1c59c6c34584b806004e77362e31", + "version": 2, + "include_node_ids": [ + "61bbc2b4385e4f508c9f3c361526ef36", + "e764e7ad06124476855b34d7fc80bb73" + ] + }, + { + "id": "dd28be6f502c42b2a1d96396a930a446", + "version": 3, + "include_node_ids": [ + "dc41def0c52249c6a090ad11cf81ac46", + "5881096609164e909cdaf3f8caba60e1" + ] + } + ], + "metadata": { + "title": "Spanish-Extras", + "subtitle": "0001", + "description": "spanish-extras", + "required_gigabytes": 0, + "tagged_node_ids": [ + { + "node_id": "dc4f1c59c6c34584b806004e77362e31", + "tags": [ + "featured-channel" + ] + }, + { + "node_id": "61bbc2b4385e4f508c9f3c361526ef36", + "tags": [ + "highlight" + ] + }, + { + "node_id": "e764e7ad06124476855b34d7fc80bb73", + "tags": [ + "highlight" + ] + }, + { + "node_id": "dc41def0c52249c6a090ad11cf81ac46", + "tags": [ + "highlight" + ] + }, + { + "node_id": "5881096609164e909cdaf3f8caba60e1", + "tags": [ + "highlight" + ] + } + ] + }, + "channel_list_hash": "" +} \ No newline at end of file diff --git a/kolibri_explore_plugin/test/conftest.py b/kolibri_explore_plugin/test/conftest.py index 90fb36c6f..7f49fb152 100644 --- a/kolibri_explore_plugin/test/conftest.py +++ b/kolibri_explore_plugin/test/conftest.py @@ -4,9 +4,201 @@ # SPDX-License-Identifier: GPL-2.0-or-later import pytest from django.core.management import call_command +from kolibri.utils.conf import OPTIONS + +from .utils import COLLECTIONSDIR +from .utils import ContentServer +from .utils import create_contentdir + + +@pytest.fixture(autouse=True) +def kolibri_options(monkeypatch): + """Set Kolibri options for testing""" + monkeypatch.setitem( + OPTIONS["Explore"], + "CONTENT_COLLECTIONS_PATH", + str(COLLECTIONSDIR), + ) + + # collectionviews has a bunch of global singletons that need to be reset + # per test. + from kolibri_explore_plugin import collectionviews + + monkeypatch.setattr( + collectionviews, + "COLLECTION_PATHS", + str(COLLECTIONSDIR), + ) + monkeypatch.setattr( + collectionviews, + "_content_manifests", + [], + ) + monkeypatch.setattr( + collectionviews, + "_content_manifests_by_language", + {}, + ) + monkeypatch.setattr( + collectionviews, + "_content_manifests_by_grade_name", + {}, + ) + monkeypatch.setattr( + collectionviews, + "_collection_download_manager", + collectionviews.CollectionDownloadManager(), + ) + + # Re-read the collections. + collectionviews._read_content_manifests() @pytest.fixture def content_data(db): """Load test content database fixture""" call_command("loaddata", "test-content.json") + + +@pytest.fixture(scope="session") +def serverdir(tmp_path_factory): + """Session scoped server root directory""" + return tmp_path_factory.mktemp("server") + + +@pytest.fixture(scope="session") +def contentdir(serverdir): + """Session scoped server content directory""" + contentdir = serverdir / "content" + create_contentdir(contentdir) + return contentdir + + +@pytest.fixture +def content_server(serverdir, contentdir, monkeypatch): + """HTTP content server using test data""" + from kolibri.core.discovery.utils.network.client import NetworkClient + from kolibri.core.content.utils import resource_import + + with ContentServer(serverdir) as server: + # Override the Kolibri content server URL. + monkeypatch.setitem( + OPTIONS["Urls"], + "CENTRAL_CONTENT_BASE_URL", + server.url, + ) + + # Don't introspect the server for info. + monkeypatch.setattr( + NetworkClient, + "build_for_address", + lambda addr: NetworkClient(addr), + ) + monkeypatch.setattr( + resource_import, + "lookup_channel_listing_status", + lambda channel_id, baseurl: None, + ) + + yield server + + +@pytest.fixture +def facility(): + """Create Kolibri facility""" + from kolibri.core.auth.models import Facility + + return Facility.objects.create(name="facility") + + +@pytest.fixture +def facility_user(facility): + """Create Kolibri facility user with manage content permissions""" + from kolibri.core.auth.models import FacilityUser + from kolibri.core.device.models import DevicePermissions + + user = FacilityUser.objects.create(username="test", facility=facility) + user.set_password("test") + user.save() + DevicePermissions.objects.create( + user=user, is_superuser=False, can_manage_content=True + ) + return user + + +@pytest.fixture +def channel_import_db(transactional_db, monkeypatch): + """Database setup for use when importing channels + + Normal django database test usage (like with django's TestCase) uses + a database transaction that's thrown out at the end of the test. + Transactional django database test usage (like with django's + TransactionTestCase) truncates all database tables at the end of the + test. The preferred method is a database transaction since it's much + faster. + + However, when performing a channel import, the database is being + updated with sqlachemy. The sqlalchemy database access won't be part + of the database transaction and neither it nor the django ORM will + see each other's activity. Therefore, transactional_db is needed + whenever the database will be accessed by both django and + sqlalchemy. Furthermore, sqlalchemy needs to be told to connect + differently for these tests. + """ + from kolibri.core.content.test.sqlalchemytesting import ( + django_connection_engine, + ) + from kolibri.core.content.utils import sqlalchemybridge + + _get_engine = sqlalchemybridge.get_engine + + def get_engine(connection_string): + if connection_string == sqlalchemybridge.get_default_db_string(): + return django_connection_engine() + return _get_engine(connection_string) + + monkeypatch.setattr(sqlalchemybridge, "get_engine", get_engine) + + return transactional_db + + +@pytest.fixture +def worker(tmp_path, monkeypatch): + """Kolibri tasks worker + + A temporary job storage database is used so that it's automatically + destroyed at the end of the test. + """ + from kolibri.core.tasks import api + from kolibri.core.tasks import main + from kolibri.core.tasks import registry + from kolibri.core.tasks.storage import Storage + from kolibri.core.tasks.utils import db_connection + from kolibri_explore_plugin import collectionviews + from kolibri_explore_plugin import jobs + + jobs_db_path = tmp_path / "job_storage.sqlite3" + monkeypatch.setitem( + OPTIONS["Tasks"], + "JOB_STORAGE_FILEPATH", + str(jobs_db_path), + ) + + connection = db_connection() + storage = Storage(connection=connection) + + # Override several references to the Kolibri tasks global connection and + # job_storage objects. + monkeypatch.setattr(main, "connection", connection) + monkeypatch.setattr(main, "job_storage", storage) + monkeypatch.setattr(api, "job_storage", storage) + monkeypatch.setattr(registry, "job_storage", storage) + monkeypatch.setattr(collectionviews, "job_storage", storage) + monkeypatch.setattr(jobs, "job_storage", storage) + + worker = main.initialize_workers() + try: + yield + finally: + worker.shutdown(wait=True) + connection.dispose() diff --git a/kolibri_explore_plugin/test/plugin.py b/kolibri_explore_plugin/test/plugin.py index 31539c2e7..fdca3910a 100644 --- a/kolibri_explore_plugin/test/plugin.py +++ b/kolibri_explore_plugin/test/plugin.py @@ -49,10 +49,16 @@ def empty_logging_config(*args, **kwargs): # Enable our plugin and initialize the homedir. from kolibri.main import initialize from kolibri.plugins import config + from kolibri.utils.conf import OPTIONS config["INSTALLED_PLUGINS"].add("kolibri_explore_plugin") initialize() + # Always set a non-production run mode and disable pings so that they don't + # hang and interfere with other tasks. + OPTIONS["Deployment"]["RUN_MODE"] = "test" + OPTIONS["Deployment"]["DISABLE_PING"] = True + @pytest.hookimpl(tryfirst=True) def pytest_load_initial_conftests(early_config, parser, args): diff --git a/kolibri_explore_plugin/test/test_collectionviews.py b/kolibri_explore_plugin/test/test_collectionviews.py new file mode 100644 index 000000000..23fc26201 --- /dev/null +++ b/kolibri_explore_plugin/test/test_collectionviews.py @@ -0,0 +1,190 @@ +import json +import time +from itertools import product + +import pytest +from django.urls import reverse +from kolibri.core.content.models import ChannelMetadata +from kolibri.core.content.models import ContentNode +from rest_framework.test import APIClient + +from .utils import COLLECTIONSDIR +from .utils import ExploreTestTimeoutError +from .utils import wait_for_background_tasks +from kolibri_explore_plugin import collectionviews + + +@pytest.mark.django_db +def test_get_collection_info(): + url = reverse("kolibri:kolibri_explore_plugin:get_collection_info") + client = APIClient() + + # Unspecified or missing grade/name results in null info. + for grade, name in ( + (None, None), + ("foo", None), + (None, "foo"), + ("foo", "bar"), + ): + params = {} + if grade: + params["grade"] = grade + if name: + params["name"] = name + resp = client.get(url, params) + assert resp.status_code == 200 + assert resp.json() == {"collectionInfo": None} + + # Test each supported collection. + for grade in collectionviews.COLLECTION_GRADES: + for name in collectionviews.COLLECTION_NAMES: + collection_path = COLLECTIONSDIR / f"{grade}-{name}.json" + with collection_path.open("r") as f: + collection_data = json.load(f) + expected_data = { + "collectionInfo": { + "grade": grade, + "name": name, + "metadata": collection_data["metadata"], + "available": True, + "channelsCount": len(collection_data["channels"]), + } + } + + resp = client.get(url, {"grade": grade, "name": name}) + assert resp.status_code == 200 + assert resp.json() == expected_data + + +@pytest.mark.django_db +def test_get_all_collections_info(): + url = reverse("kolibri:kolibri_explore_plugin:get_all_collections_info") + client = APIClient() + + all_collections_info = [] + for grade in collectionviews.COLLECTION_GRADES: + grade_info = {"grade": grade, "collections": []} + all_collections_info.append(grade_info) + for name in collectionviews.COLLECTION_NAMES: + collection_path = COLLECTIONSDIR / f"{grade}-{name}.json" + with collection_path.open("r") as f: + collection_data = json.load(f) + grade_info["collections"].append( + { + "grade": grade, + "name": name, + "metadata": collection_data["metadata"], + "available": True, + "channelsCount": len(collection_data["channels"]), + } + ) + expected_data = {"allCollectionsInfo": all_collections_info} + + resp = client.get(url) + assert resp.status_code == 200 + assert resp.json() == expected_data + + +@pytest.mark.django_db +def test_get_should_resume(): + url = reverse("kolibri:kolibri_explore_plugin:get_should_resume") + client = APIClient() + session = client.session + + # With no existing state. + current_state = None + state = session.get("COLLECTIONS_STATE") + assert state == current_state + resp = client.get(url) + assert resp.json() == {"shouldResume": False, "grade": None, "name": None} + + # Intermediate state. + current_state = { + "grade": "artist", + "name": "0001", + "stage": collectionviews.DownloadStage.IMPORTING_CONTENT.name, + } + session["COLLECTIONS_STATE"] = current_state + session.save() + state = session.get("COLLECTIONS_STATE") + assert state == current_state + resp = client.get(url) + assert resp.json() == { + "shouldResume": True, + "grade": "artist", + "name": "0001", + } + + # Completed state. + current_state = { + "grade": "artist", + "name": "0001", + "stage": collectionviews.DownloadStage.COMPLETED.name, + } + session["COLLECTIONS_STATE"] = current_state + session.save() + state = session.get("COLLECTIONS_STATE") + assert state == current_state + resp = client.get(url) + assert resp.json() == { + "shouldResume": False, + "grade": "artist", + "name": "0001", + } + + +def run_download_manager(manager, manifest, user, timeout=30): + """Update the download manager until it completes + + Raises ExploreTestTimeoutError if it hasn't completed in timeout seconds. + """ + manager.start(manifest, user) + deadline = time.monotonic() + timeout + while True: + manager.update(user) + status = manager.get_status() + if status["stage"] == collectionviews.DownloadStage.COMPLETED.name: + return + + if time.monotonic() >= deadline: + raise ExploreTestTimeoutError( + f"Download manager did not complete within {timeout} seconds" + ) + time.sleep(0.5) + + +# Kolibri's task worker seems to hang occasionally, causing the download tasks +# to never complete. Retry twice on timeouts. +@pytest.mark.flaky(reruns=2, only_rerun="ExploreTestTimeoutError") +@pytest.mark.usefixtures("channel_import_db", "worker", "content_server") +@pytest.mark.django_db +@pytest.mark.parametrize( + ("grade", "name"), + product( + collectionviews.COLLECTION_GRADES, collectionviews.COLLECTION_NAMES + ), +) +def test_download_manager_clean(facility_user, grade, name): + """Test collections downloads from no content state""" + manifest = collectionviews._content_manifests_by_grade_name[grade][name] + manager = collectionviews.CollectionDownloadManager() + + # Run the download manager and then wait for the background download tasks + # to complete. + run_download_manager(manager, manifest, facility_user) + wait_for_background_tasks() + + # Check that the correct number of channels, nodes and tags are present. + # Each pack has 2 channels with 2 included nodes each. Each channel has 6 + # nodes. The included nodes from each channel end up downloading 4 nodes - + # root topic, video, subtopic and document. So, each pack will have 8 + # available nodes. The extra packs don't cause any nodes to become + # available since only the thumbnails are downloaded. + assert manifest.language in ("en", "es") + if manifest.language == "en": + num_packs = len(collectionviews.COLLECTION_GRADES_EN) + elif manifest.language == "es": + num_packs = len(collectionviews.COLLECTION_GRADES_ES) + assert ChannelMetadata.objects.count() == 2 * num_packs + assert ContentNode.objects.filter().count() == 12 * num_packs + assert ContentNode.objects.filter(available=True).count() == 8 diff --git a/kolibri_explore_plugin/test/test_jobs.py b/kolibri_explore_plugin/test/test_jobs.py new file mode 100644 index 000000000..c84426aae --- /dev/null +++ b/kolibri_explore_plugin/test/test_jobs.py @@ -0,0 +1,161 @@ +import pytest +from django.core.management import call_command +from kolibri.core.content.models import ChannelMetadata +from kolibri.core.tasks.job import State + +from .utils import wait_for_background_tasks +from kolibri_explore_plugin import jobs +from kolibri_explore_plugin.models import BackgroundTask + + +def importchannel(channel_id): + return call_command("importchannel", "network", channel_id) + + +def test_get_applyexternaltags_task(): + node_id = "b51baf46133045e3bce4d2d872a8f71d" + tags = ["foo", "bar", "baz"] + task = jobs.get_applyexternaltags_task(node_id, tags) + assert task == { + "task": jobs.TaskType.APPLYEXTERNALTAGS, + "params": { + "node_id": node_id, + "tags": tags, + }, + } + + +@pytest.mark.usefixtures("channel_import_db", "content_server") +@pytest.mark.django_db +def test_get_remotechannelimport_task(): + channel_id = "b51baf46133045e3bce4d2d872a8f71d" + task = jobs.get_remotechannelimport_task(channel_id) + assert task == { + "task": jobs.TaskType.REMOTECHANNELIMPORT, + "params": { + "channel_id": channel_id, + "channel_name": "unknown", + }, + } + + # Specify the channel name. + task = jobs.get_remotechannelimport_task(channel_id, "foo") + assert task == { + "task": jobs.TaskType.REMOTECHANNELIMPORT, + "params": { + "channel_id": channel_id, + "channel_name": "foo", + }, + } + + # After importing the channel, the channel name will be known. + importchannel(channel_id) + task = jobs.get_remotechannelimport_task(channel_id) + assert task == { + "task": jobs.TaskType.REMOTECHANNELIMPORT, + "params": { + "channel_id": channel_id, + "channel_name": "testing", + }, + } + + +@pytest.mark.usefixtures("channel_import_db", "content_server") +@pytest.mark.django_db +def test_get_remotecontentimport_task(): + channel_id = "b51baf46133045e3bce4d2d872a8f71d" + node_ids = [ + "5a24503255ce43d98ebcb25d2b60f024", + "91a1bfc0ede544979f861909b7862537", + ] + + # If the channel doesn't exist an exception will be raised. + with pytest.raises(ChannelMetadata.DoesNotExist): + jobs.get_remotecontentimport_task(channel_id) + + # Import the channel and try again with no nodes specified. + importchannel(channel_id) + task = jobs.get_remotecontentimport_task(channel_id) + assert task == { + "task": jobs.TaskType.REMOTECONTENTIMPORT, + "params": { + "channel_id": channel_id, + "channel_name": "testing", + "node_ids": None, + "exclude_node_ids": [], + "all_thumbnails": False, + "fail_on_error": True, + }, + } + + # Specify the nodes. + task = jobs.get_remotecontentimport_task(channel_id, node_ids=node_ids) + assert task == { + "task": jobs.TaskType.REMOTECONTENTIMPORT, + "params": { + "channel_id": channel_id, + "channel_name": "testing", + "node_ids": node_ids, + "exclude_node_ids": [], + "all_thumbnails": False, + "fail_on_error": True, + }, + } + + # Override the channel name. + task = jobs.get_remotecontentimport_task(channel_id, channel_name="foo") + assert task == { + "task": jobs.TaskType.REMOTECONTENTIMPORT, + "params": { + "channel_id": channel_id, + "channel_name": "foo", + "node_ids": None, + "exclude_node_ids": [], + "all_thumbnails": False, + "fail_on_error": True, + }, + } + + # Specify an empty node list and all_thumbnails. + task = jobs.get_remotecontentimport_task( + channel_id, node_ids=[], all_thumbnails=True + ) + assert task == { + "task": jobs.TaskType.REMOTECONTENTIMPORT, + "params": { + "channel_id": channel_id, + "channel_name": "testing", + "node_ids": [], + "exclude_node_ids": [], + "all_thumbnails": True, + "fail_on_error": True, + }, + } + + +@pytest.mark.usefixtures( + "channel_import_db", "content_server", "facility_user", "worker" +) +@pytest.mark.django_db +def test_enqueue_next_background_task(): + # Create a content import task. Note that a channel import task isn't used + # here because that also enqueues a subsequent thumbnail import task. + channel_id = "b51baf46133045e3bce4d2d872a8f71d" + node_ids = [ + "5a24503255ce43d98ebcb25d2b60f024", + "91a1bfc0ede544979f861909b7862537", + ] + importchannel(channel_id) + task_data = jobs.get_remotecontentimport_task( + channel_id, node_ids=node_ids + ) + task = BackgroundTask.create_from_task_data(task_data) + + enqueued_task = jobs.enqueue_next_background_task() + assert enqueued_task == task + wait_for_background_tasks(10) + + # Check that the task completed and no other background tasks were run. + task.refresh_from_db() + assert task.job_state == State.COMPLETED + assert list(BackgroundTask.objects.all()) == [task] diff --git a/kolibri_explore_plugin/test/utils.py b/kolibri_explore_plugin/test/utils.py new file mode 100644 index 000000000..db2500506 --- /dev/null +++ b/kolibri_explore_plugin/test/utils.py @@ -0,0 +1,239 @@ +# Test utilities +# +# Copyright 2023 Endless OS Foundation LLC +# SPDX-License-Identifier: GPL-2.0-or-later +import functools +import json +import logging +import multiprocessing +import os +import queue +import threading +import time +from base64 import b64decode +from glob import iglob +from hashlib import md5 +from http.server import SimpleHTTPRequestHandler +from http.server import ThreadingHTTPServer +from pathlib import Path + +from django.db import OperationalError +from kolibri.core.tasks.job import State + +from kolibri_explore_plugin.models import BackgroundTask + +logger = logging.getLogger(__name__) + +TESTDIR = Path(__file__).parent.resolve() +CHANNELSDIR = TESTDIR / "channels" +COLLECTIONSDIR = TESTDIR / "collections" + + +class ExploreTestError(Exception): + """Exceptions from kolibri-explore-plugin tests""" + + pass + + +class ExploreTestTimeoutError(ExploreTestError): + """Timeout exceptions from kolibri-explore-plugin tests""" + + pass + + +def create_contentdir(content_path, channels_path=CHANNELSDIR): + """Create content directory from channel JSON files""" + from kolibri.core.content.constants.schema_versions import ( + CURRENT_SCHEMA_VERSION, + ) + from kolibri.core.content.utils.sqlalchemybridge import Bridge + + databases_path = content_path / "databases" + databases_path.mkdir(parents=True, exist_ok=True) + storage_path = content_path / "storage" + storage_path.mkdir(parents=True, exist_ok=True) + + for json_path in iglob(f"{channels_path}/*.json"): + logger.info(f"Loading channel JSON {json_path}") + with open(json_path, "r") as f: + data = json.load(f) + + channels = data["content_channelmetadata"] + if len(channels) != 1: + raise ValueError( + "Must be one channel in content_channelmetadata table" + ) + + channel_id = channels[0]["id"] + db_path = databases_path / f"{channel_id}.sqlite3" + if db_path.exists(): + logger.info(f"Removing existing channel database {db_path}") + db_path.unlink() + + logger.info(f"Creating channel database {db_path}") + bridge = Bridge(db_path, schema_version=CURRENT_SCHEMA_VERSION) + bridge.Base.metadata.bind = bridge.engine + bridge.Base.metadata.create_all() + + # Create the content files from the localfile _content entries. + logger.info(f"Creating channel {channel_id} content files") + for localfile in data["content_localfile"]: + id = localfile["id"] + size = localfile["file_size"] + ext = localfile["extension"] + content = b64decode(localfile.pop("_content")) + content_size = len(content) + if content_size != size: + raise ValueError( + f"Localfile {id} size {size} does not match " + f"content size {content_size}" + ) + content_md5 = md5(content).hexdigest() + if content_md5 != id: + raise ValueError( + f"Localfile {id} does not match content md5sum " + f"{content_md5}" + ) + + # If the file already exists, validate its contents. Otherwise, + # create it. + localfile_dir = storage_path / f"{id[0]}/{id[1]}" + localfile_dir.mkdir(parents=True, exist_ok=True) + localfile_path = localfile_dir / f"{id}.{ext}" + if localfile_path.exists(): + logger.info(f"Validating content file {localfile_path}") + localfile_size = os.path.getsize(localfile_path) + if localfile_size != size: + raise ValueError( + f"Localfile {id} size {size} does not match " + f"{localfile_path} size {localfile_size}" + ) + with open(localfile_path, "rb") as f: + localfile_content = f.read() + if localfile_content != content: + raise ValueError( + f"Localfile {id} content does not match " + f"{localfile_path} content" + ) + else: + logger.debug(f"Creating content file {localfile_path}") + with open(localfile_path, "wb") as f: + f.write(content) + + # Now fill all the database tables. + for table in bridge.Base.metadata.sorted_tables: + if data.get(table.name): + bridge.connection.execute(table.insert(), data[table.name]) + + bridge.end() + + +def wait_for_background_tasks(timeout=30): + """Wait for background tasks to complete with a timeout + + Raises ExploreTestTimeoutError if they haven't completed in timeout + seconds. + """ + deadline = time.monotonic() + timeout + while True: + # The storage hook is run from the worker, which is in a separate + # thread. Since it accesses the BackgroundTask table, this code is + # attempting to access the table concurrently. Occasionally that will + # throw an OperationalError because sqlite locks the table in each + # connection. Ignore that and carry on. + try: + incomplete_jobs = BackgroundTask.objects.exclude( + job_state=State.COMPLETED + ) + num_incomplete_jobs = len(incomplete_jobs) + except OperationalError: + logger.exception("Could not query incomplete background tasks") + time.sleep(0.5) + continue + + if num_incomplete_jobs == 0: + logger.debug("All background tasks competed") + return + + if time.monotonic() >= deadline: + raise ExploreTestTimeoutError( + f"Background tasks did not complete within {timeout} seconds" + ) + logger.debug( + f"Waiting for incomplete background tasks: {incomplete_jobs}" + ) + time.sleep(0.5) + + +class LoggingHTTPRequestHandler(SimpleHTTPRequestHandler): + """SimpleHTTPRequestHandler with logging""" + + def log_message(self, format, *args): + logger.debug( + "%s: %s - - [%s] %s", + threading.current_thread().name, + self.address_string(), + self.log_date_time_string(), + format % args, + ) + + +class ContentServer: + """Content HTTP server""" + + def __init__(self, path): + self.path = Path(path) + self.proc = None + self.address = None + self.url = None + + if not self.path.is_dir(): + raise ValueError(f"{path} is not a directory") + + def __enter__(self): + self.start() + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.stop() + + def _run_server(self, path, queue): + handler_class = functools.partial( + LoggingHTTPRequestHandler, + directory=path, + ) + server = ThreadingHTTPServer(("127.0.0.1", 0), handler_class) + queue.put(server.server_address) + server.serve_forever() + + def start(self): + """Start the HTTP server + + A separate process is used so that the HTTP server can block. + """ + addr_queue = multiprocessing.Queue() + self.proc = multiprocessing.Process( + target=self._run_server, args=(self.path, addr_queue) + ) + self.proc.start() + if not self.proc.is_alive(): + raise ExploreTestError(f"HTTP process {self.proc.pid} exited") + try: + self.address = addr_queue.get(True, 5) + except queue.Empty: + raise ExploreTestError( + "HTTP process did not write address to queue" + ) from None + + self.url = f"http://{self.address[0]}:{self.address[1]}" + logger.debug( + f"Serving {self.path} on {self.url} from process {self.proc.pid}" + ) + + def stop(self): + """Stop the HTTP server""" + if self.proc is not None: + if self.proc.is_alive(): + logger.debug(f"Stopping HTTP server process {self.proc.pid}") + self.proc.terminate() + self.proc = None diff --git a/pyproject.toml b/pyproject.toml index 51808423c..0aa59e504 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,3 +77,9 @@ testpaths = 'kolibri_explore_plugin/test' # FIXME: Try to narrow the deprecation warnings to only those caused by # Kolibri. filterwarnings = 'ignore::DeprecationWarning' + +# Logging configuration. By default set the log level to INFO so there's +# useful information on failures. Task handling is multithreaded, so add +# the thread name to help debugging. +log_level = 'INFO' +log_format = '%(levelname)-8s %(name)s %(threadName)s %(message)s' diff --git a/scripts/create_channeldb_json.py b/scripts/create_channeldb_json.py new file mode 100755 index 000000000..6e1ad1785 --- /dev/null +++ b/scripts/create_channeldb_json.py @@ -0,0 +1,244 @@ +#!/usr/bin/env python3 +# Copyright 2023 Endless OS Foundation LLC +# SPDX-License-Identifier: GPL-2.0-or-later +import json +import sys +from argparse import ArgumentParser +from base64 import b64encode +from hashlib import md5 +from pathlib import Path +from random import randbytes +from random import randint +from uuid import uuid4 + +SRCDIR = Path(__file__).parent.parent +CHANNELSDIR = SRCDIR / "kolibri_explore_plugin/test/channels" + + +def random_id(): + """Create a random UUID4 ID""" + return str(uuid4().hex) + + +def random_b64(size): + """Create random base64 encoded data""" + return b64encode(randbytes(size)).decode("ascii") + + +def generate_channel(): + """Generate channel parameters""" + channel_id = random_id() + return { + "id": channel_id, + "root_id": channel_id, + "thumbnail": f"data:image/jpg;base64,{random_b64(30)}", + "version": randint(1, 4), + } + + +def generate_nodes(channel): + """Generate content node parameters""" + root = { + "id": channel["root_id"], + "channel_id": channel["id"], + "content_id": channel["root_id"], + "parent_id": None, + } + topic_id = random_id() + + def root_node(node_id=None): + if node_id is None: + node_id = random_id() + return { + "id": node_id, + "channel_id": channel["id"], + "content_id": random_id(), + "parent_id": root["id"], + } + + def topic_node(): + return { + "id": random_id(), + "channel_id": channel["id"], + "content_id": random_id(), + "parent_id": topic_id, + } + + return [ + root, + root_node(), + root_node(topic_id), + topic_node(), + topic_node(), + topic_node(), + ] + + +def generate_localfiles(): + """Generate content localfile parameters""" + + def localfile(): + size = randint(1, 30) + content = randbytes(size) + content_b64 = b64encode(content).decode("ascii") + checksum = md5(content).hexdigest() + return { + "id": checksum, + "file_size": size, + "_content": content_b64, + } + + return [localfile() for _ in range(10)] + + +def generate_files(nodes, localfiles): + """Generate content file parameters""" + + def node_file(node, localfile): + return { + "id": random_id(), + "contentnode_id": node["id"], + "local_file_id": localfile["id"], + } + + return [ + node_file(nodes[1], localfiles[0]), + node_file(nodes[1], localfiles[1]), + node_file(nodes[1], localfiles[2]), + node_file(nodes[1], localfiles[3]), + node_file(nodes[2], localfiles[4]), + node_file(nodes[3], localfiles[5]), + node_file(nodes[3], localfiles[6]), + node_file(nodes[4], localfiles[7]), + node_file(nodes[4], localfiles[8]), + node_file(nodes[5], localfiles[9]), + ] + + +def generate_tags(): + """Generate content tag parameters""" + return [{"id": random_id()} for _ in range(3)] + + +def generate_node_tags(nodes, tags): + """Generate content node tag parameters""" + + def node_tag(node, tag): + return { + "contentnode_id": node["id"], + "contenttag_id": tag["id"], + } + + return [ + node_tag(nodes[0], tags[0]), + node_tag(nodes[0], tags[1]), + node_tag(nodes[0], tags[2]), + node_tag(nodes[1], tags[0]), + node_tag(nodes[2], tags[1]), + ] + + +def generate_prerequisites(nodes): + """Generate content node prerequisites parameters""" + return [ + { + "from_contentnode_id": nodes[1]["id"], + "to_contentnode_id": nodes[0]["id"], + }, + ] + + +def generate_related(nodes): + """Generate content node related parameters""" + return [ + { + "from_contentnode_id": nodes[1]["id"], + "to_contentnode_id": nodes[2]["id"], + }, + { + "from_contentnode_id": nodes[2]["id"], + "to_contentnode_id": nodes[1]["id"], + }, + ] + + +def generate_params(): + """Generate channel DB parameters""" + channel = generate_channel() + nodes = generate_nodes(channel) + localfiles = generate_localfiles() + files = generate_files(nodes, localfiles) + tags = generate_tags() + node_tags = generate_node_tags(nodes, tags) + prerequisites = generate_prerequisites(nodes) + related = generate_related(nodes) + + return { + "channel": channel, + "nodes": nodes, + "files": files, + "localfiles": localfiles, + "tags": tags, + "node_tags": node_tags, + "prerequisites": prerequisites, + "related": related, + } + + +def substitute_params(data, params): + """Substitute channel DB parameters in template data""" + data["content_channelmetadata"][0].update(params["channel"]) + for index, node in enumerate(data["content_contentnode"]): + node.update(params["nodes"][index]) + for index, file in enumerate(data["content_file"]): + file.update(params["files"][index]) + for index, localfile in enumerate(data["content_localfile"]): + localfile.update(params["localfiles"][index]) + for index, tag in enumerate(data["content_contenttag"]): + tag.update(params["tags"][index]) + for index, node_tag in enumerate(data["content_contentnode_tags"]): + node_tag.update(params["node_tags"][index]) + for index, prereq in enumerate( + data["content_contentnode_has_prerequisite"] + ): + prereq.update(params["prerequisites"][index]) + for index, relation in enumerate(data["content_contentnode_related"]): + relation.update(params["related"][index]) + + +def main(): + ap = ArgumentParser(description="Create fake channel DB JSON") + ap.add_argument( + "-c", + "--channelsdir", + metavar="CHANNELSDIR", + type=Path, + default=CHANNELSDIR, + help="test channels directory (default: %(default)s)", + ) + ap.add_argument( + "-n", + "--dry-run", + action="store_true", + help="only show the generated JSON", + ) + args = ap.parse_args() + + params = generate_params() + template = args.channelsdir / "db.json.template" + with open(template) as f: + data = json.load(f) + substitute_params(data, params) + + if args.dry_run: + json.dump(data, sys.stdout, indent=2) + else: + channel_id = params["channel"]["id"] + path = args.channelsdir / f"{channel_id}.json" + print(f"Creating {channel_id} database JSON {path}") + with open(path, "w") as f: + json.dump(data, f, indent=2) + + +if __name__ == "__main__": + main() diff --git a/scripts/create_collection_pack.py b/scripts/create_collection_pack.py new file mode 100755 index 000000000..5b718f330 --- /dev/null +++ b/scripts/create_collection_pack.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python3 +# Copyright 2023 Endless OS Foundation LLC +# SPDX-License-Identifier: GPL-2.0-or-later +import json +import sys +from argparse import ArgumentParser +from pathlib import Path + +SRCDIR = Path(__file__).parent.parent +CHANNELSDIR = SRCDIR / "kolibri_explore_plugin/test/channels" +COLLECTIONSDIR = SRCDIR / "kolibri_explore_plugin/test/collections" + + +def generate_params(name, version, channel_ids): + """Generate collection pack parameters""" + metadata = { + "title": name.title(), + "subtitle": version, + "description": name, + } + + channels = [] + tagged_nodes = [] + for index, channel_id in enumerate(channel_ids): + channel_path = CHANNELSDIR / f"{channel_id}.json" + with open(channel_path) as f: + channel_data = json.load(f) + + channels.append( + { + "id": channel_id, + "version": channel_data["content_channelmetadata"][0][ + "version" + ], + "include_node_ids": [ + channel_data["content_contentnode"][1]["id"], + channel_data["content_contentnode"][4]["id"], + ], + } + ) + + # Add the first channel root ID as the first tagged node. + if index == 0: + tagged_nodes.append( + { + "node_id": channel_data["content_channelmetadata"][0][ + "root_id" + ], + } + ) + tagged_nodes += [ + { + "node_id": channel_data["content_contentnode"][1]["id"], + }, + { + "node_id": channel_data["content_contentnode"][4]["id"], + }, + ] + + return { + "metadata": metadata, + "channels": channels, + "tagged_nodes": tagged_nodes, + } + + +def substitute_params(data, params): + """Substitute pack parameters in template data""" + data["metadata"].update(params["metadata"]) + for index, entry in enumerate(data["channels"]): + entry.update(params["channels"][index]) + for index, entry in enumerate(data["metadata"]["tagged_node_ids"]): + entry.update(params["tagged_nodes"][index]) + + +def main(): + ap = ArgumentParser(description="Create fake channel DB JSON") + ap.add_argument( + "name", + metavar="NAME", + help="collection pack name (e.g., artist)", + ) + ap.add_argument( + "version", + metavar="VERSION", + help="collection pack version (e.g., 0001)", + ) + ap.add_argument( + "channels", + metavar="CHANNEL", + nargs=2, + help="channel IDs", + ) + ap.add_argument( + "-c", + "--collectionsdir", + metavar="COLLECTIONSDIR", + type=Path, + default=COLLECTIONSDIR, + help="test collections directory (default: %(default)s)", + ) + ap.add_argument( + "--channelsdir", + metavar="CHANNELSDIR", + type=Path, + default=CHANNELSDIR, + help="test channels directory (default: %(default)s)", + ) + ap.add_argument( + "-n", + "--dry-run", + action="store_true", + help="only show the generated JSON", + ) + args = ap.parse_args() + + params = generate_params(args.name, args.version, args.channels) + template = args.collectionsdir / "pack.json.template" + with open(template) as f: + data = json.load(f) + substitute_params(data, params) + + if args.dry_run: + json.dump(data, sys.stdout, indent=2) + else: + path = args.collectionsdir / f"{args.name}-{args.version}.json" + print(f"Creating {args.name}-{args.version} pack JSON {path}") + with open(path, "w") as f: + json.dump(data, f, indent=2) + + +if __name__ == "__main__": + main() diff --git a/scripts/create_contentdir.py b/scripts/create_contentdir.py new file mode 100755 index 000000000..ce7f55cab --- /dev/null +++ b/scripts/create_contentdir.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +# Copyright 2023 Endless OS Foundation LLC +# SPDX-License-Identifier: GPL-2.0-or-later +import os +from argparse import ArgumentParser +from pathlib import Path +from tempfile import TemporaryDirectory + +from kolibri_explore_plugin.test.utils import create_contentdir + +SRCDIR = Path(__file__).parent.parent +CHANNELSDIR = SRCDIR / "kolibri_explore_plugin/test/channels" + + +def main(): + ap = ArgumentParser(description="Create channel database from JSON") + ap.add_argument( + "contentdir", + metavar="CONTENTDIR", + type=Path, + help="content output directory", + ) + ap.add_argument( + "-c", + "--channelsdir", + metavar="CHANNELSDIR", + type=Path, + default=CHANNELSDIR, + help="test channels directory (default: %(default)s)", + ) + args = ap.parse_args() + + # Unfortunately, sqlalchemybridge can't be used without an initialized + # Kolibri homedir, so make a temporary one. + with TemporaryDirectory(prefix="kolibri-home-") as kolibri_home: + os.environ["KOLIBRI_HOME"] = kolibri_home + from kolibri.main import initialize + + initialize() + create_contentdir(args.contentdir, args.channelsdir) + + +if __name__ == "__main__": + main()