Compare commits

..

407 Commits

Author SHA1 Message Date
gitea fa433d40f6 Merge branch 'main' of https://github.com/migatu/conjurer 2024-04-10 13:18:22 +02:00
gitea 41eb0f9245 Serverside search. 2024-04-10 13:17:58 +02:00
gitea db46aea55b Start work on views 2024-04-10 13:16:32 +02:00
gitea 95785199c0 Drmf 2024-04-09 19:21:06 +02:00
gitea 0584df9143 FIxed logging issue 2024-04-09 16:23:12 +02:00
gitea 1ee475fc74 fix 2024-04-09 13:47:44 +02:00
gitea 89c0cc68d8 Too much logging 2024-04-09 13:32:59 +02:00
gitea 9c5173d2c7 Finally! THis is my final form! 2024-04-09 13:32:14 +02:00
gitea 8abad9b862 KURWA!!!!!!! 2024-04-09 13:30:12 +02:00
gitea 6292cf26b7 More logging 2024-04-09 13:26:44 +02:00
gitea ed2167eae1 More logging 2024-04-09 13:22:10 +02:00
gitea 562de83a16 more logging 2024-04-09 13:19:43 +02:00
gitea a18cc43fa6 Comm check 2024-04-09 13:17:16 +02:00
gitea f30fee78bf Back to flask 2024-04-09 13:15:59 +02:00
gitea a8cbee0a6b test 2024-04-09 13:12:45 +02:00
gitea 33600ac7f7 Test 2 2024-04-09 13:01:30 +02:00
gitea 1a9ae1caa1 fix 2024-04-09 12:46:39 +02:00
gitea 58899d5738 Test 2024-04-09 12:44:23 +02:00
gitea dcfffd9602 Tak 2024-04-09 12:42:59 +02:00
gitea d5684a4336 Testing 2024-04-09 12:32:05 +02:00
gitea 0a85c6148e test 2024-04-09 01:43:35 +02:00
gitea 660e2a264a Fixed! 2024-04-09 01:38:10 +02:00
gitea a75daccf9f Ok. Fixed? 2024-04-09 01:34:24 +02:00
gitea b43321d36e FIX???? 2024-04-09 01:27:14 +02:00
gitea ee0836ed7e aaa 2024-04-09 01:22:08 +02:00
gitea 4c915ebdba Test communication 2024-04-09 01:15:12 +02:00
gitea 55fc5cc16f FIx att 4 2024-04-09 01:06:03 +02:00
gitea a484b792ea fx 2024-04-09 01:00:41 +02:00
gitea 564dd09df1 fix 2024-04-09 00:59:32 +02:00
gitea e303f9b598 fix 2024-04-09 00:57:43 +02:00
gitea 0714c1e2f6 testing 2024-04-09 00:56:35 +02:00
gitea e186c81be7 test 2024-04-09 00:53:50 +02:00
gitea 54f74907e8 aaa 2024-04-09 00:49:04 +02:00
gitea 5d8b5b0de0 test 2024-04-09 00:44:42 +02:00
gitea 1bcb2aacc2 DBG 2024-04-09 00:39:23 +02:00
gitea 3c42fb49c3 Logging fix 2024-04-09 00:38:15 +02:00
gitea 8d0aae225c Fix ? 2024-04-09 00:36:43 +02:00
gitea 217060de6c Fix 2024-04-09 00:33:48 +02:00
gitea 73033da2d5 FIX? 2024-04-09 00:31:30 +02:00
gitea f0084445d3 Fix 2024-04-09 00:26:02 +02:00
gitea bef2aa100e Attempt 3 2024-04-09 00:24:15 +02:00
gitea 1b62d5ce3f I'm a dum dum 2024-04-09 00:21:24 +02:00
gitea 3b32cdc4e7 Fix? 2024-04-09 00:16:08 +02:00
gitea e5f26566ca Troubleshooting 2024-04-09 00:13:20 +02:00
gitea 286fcd92ce Troubleshooting 2024-04-09 00:12:27 +02:00
gitea 14f35542e4 FIx 2024-04-09 00:09:12 +02:00
gitea d7b379d29e Fix 2024-04-09 00:07:18 +02:00
gitea 07f1575f96 Fix 2024-04-09 00:05:34 +02:00
gitea 5e1b962ac0 Testing 2024-04-09 00:04:35 +02:00
gitea e01fd928ca Txt 2024-04-09 00:02:18 +02:00
gitea 51e68a77ab Test 2024-04-09 00:01:19 +02:00
gitea f1940007f6 FIx host address 2024-04-08 23:58:52 +02:00
gitea e1b8a90a49 Adding flask to bo main 2024-04-08 23:37:13 +02:00
gitea e11ed40a57 QUick fix 2024-04-08 18:49:44 +02:00
gitea eda30615a1 Merge branch 'main' of https://github.com/migatu/conjurer 2024-04-08 18:48:52 +02:00
gitea b46447afed Bot side 2024-04-08 18:48:43 +02:00
gitea 1a14b9b520 Librarian side fix 2024-04-08 18:31:25 +02:00
gitea 6d3225ad00 Fix address bind 2024-04-08 15:44:35 +02:00
gitea 1649386827 Merge branch 'main' of https://github.com/migatu/conjurer 2024-04-08 15:43:48 +02:00
gitea 8bda81c80a Librarian side work 2024-04-08 15:43:31 +02:00
gitea d99e8c12ca Server pt2 2024-04-08 15:42:08 +02:00
gitea 730845e01c Server to communicate 2024-04-08 15:41:39 +02:00
gitea e93eef28b3 Threading att 1 2024-04-08 15:20:44 +02:00
gitea 9061203aae Plany 2024-04-07 22:02:53 +02:00
gitea 0fe042d0c0 Fixes! 2024-04-07 15:54:31 +02:00
gitea 345a229d06 Work in progress 2024-04-07 00:21:38 +02:00
gitea 0da4ab8874 Merge branch 'main' of https://github.com/migatu/conjurer 2024-04-06 22:49:12 +02:00
gitea 6c47b4a58d Local 2024-04-06 22:48:43 +02:00
gitea b0fe3b93a9 Update librarian 2024-04-06 22:44:36 +02:00
gitea dc85632c74 Fix fix 2024-04-06 13:45:58 +02:00
gitea 12ea3d8d28 Fix rotation 2024-04-06 13:43:39 +02:00
gitea a57591a380 final fix 2024-04-06 12:59:46 +02:00
gitea 18b08dccbd Fix att3 2024-04-06 12:57:40 +02:00
gitea 5e326cf34c Fix att 2 2024-04-06 12:55:12 +02:00
gitea d3051ccc6f fix for playlist - start 2024-04-06 12:53:28 +02:00
gitea 1d31ab5d52 Fix log rotation att 2 2024-04-06 11:40:32 +02:00
gitea b1089b29c8 Fix of the log rotation att 1 2024-04-06 02:44:03 +02:00
gitea 5b69ed6e1d Deploy! 2024-04-06 00:10:29 +02:00
gitea 2c23fc9cbf Fix3 2024-04-06 00:06:52 +02:00
gitea ac4781628b Fix 2 2024-04-05 23:32:24 +02:00
gitea c87ffee71d As 2024-04-05 23:27:38 +02:00
gitea 6f4cea61e1 Test 1 2024-04-05 23:22:58 +02:00
gitea 3bb370e5e0 Music search move file server side att 1 2024-04-05 23:17:51 +02:00
gitea 29ef0eb2bc This is seriously last fix 2024-04-05 18:08:37 +02:00
gitea c5e1da596b description update 2024-04-05 17:38:44 +02:00
gitea 04b06ebf4b last fix ? 2024-04-05 17:37:38 +02:00
gitea 5ae2d25491 Small fix 2024-04-05 17:17:17 +02:00
gitea 3c0281b77f Kolejny fix 2024-04-05 17:10:46 +02:00
gitea e47d7c0ecc Final fix 2024-04-05 16:50:57 +02:00
gitea 6790d33119 FX2 2024-04-05 16:46:12 +02:00
gitea a545e5f84d fx 2024-04-05 16:39:59 +02:00
gitea b90444dfc3 Pornol dl2 2024-04-05 16:36:17 +02:00
gitea e67eca5d41 Pornol dl 1 2024-04-05 16:35:47 +02:00
gitea efc103b1a6 Final touch 2024-04-05 13:04:42 +02:00
gitea 37b0ad3909 fix 2024-04-05 12:59:48 +02:00
gitea 24d5ba8481 Fix for description 2024-04-05 12:57:47 +02:00
gitea e742cdd45c Error handling for openai 2024-04-05 12:55:17 +02:00
gitea 26cd68b97e Timing fix 2024-04-03 15:49:44 +02:00
gitea 278f503714 Coroutine fix 2024-04-03 13:44:44 +02:00
gitea 41b60b8440 Plan for next release 2024-04-03 13:35:59 +02:00
gitea b61bbcf0db fix 2024-04-02 22:28:45 +02:00
gitea d120642d3a FX 2024-04-02 21:08:05 +02:00
gitea 0b469050b6 aa 2024-04-02 20:57:59 +02:00
gitea 5ddd72a421 a 2024-04-02 20:42:19 +02:00
gitea 7783e3637b test 2024-04-02 20:38:03 +02:00
gitea 0694171030 a 2024-04-02 20:32:50 +02:00
gitea b66ea26ce6 Viwe fix 2024-04-02 20:32:10 +02:00
gitea d96de96133 aa 2024-04-02 17:27:57 +02:00
gitea b0872df269 aa 2024-04-02 17:26:38 +02:00
gitea cb840ef714 fix 2024-04-02 17:26:18 +02:00
gitea 29fc31dd44 A 2024-04-02 17:21:15 +02:00
gitea 2f20fdfbb5 kk 2024-04-02 17:16:31 +02:00
gitea 8d688b3f7f mess 2024-04-02 17:15:02 +02:00
gitea b4673936ac aa 2024-04-02 17:13:08 +02:00
gitea e1fe7e3af8 aa 2024-04-02 17:05:06 +02:00
gitea d94ed728dd fx 2024-04-02 15:07:55 +02:00
gitea dac789c00f fx 2024-04-02 15:05:13 +02:00
gitea 0fdac8f3fd as 2024-04-02 15:03:45 +02:00
gitea 4029623ecb bb 2024-04-02 15:02:56 +02:00
gitea bb5dc5c703 asas 2024-04-02 15:01:38 +02:00
gitea 5f91ec17e4 fx 2024-04-02 14:50:54 +02:00
gitea 8534fd759e deploy 2024-04-02 14:44:36 +02:00
gitea 9288f49663 aa 2024-04-02 14:42:26 +02:00
gitea 2b5a677b72 fx 2024-04-02 14:33:20 +02:00
gitea 76a1a24e38 Fix 2024-04-02 14:31:25 +02:00
gitea 81c49acc94 a 2024-04-02 14:27:32 +02:00
gitea 103dd97f35 kk 2024-04-02 14:23:51 +02:00
gitea 5671630da2 aa 2024-04-02 14:23:27 +02:00
gitea a9cb7120ae bb 2024-04-02 14:20:28 +02:00
gitea 5c627330e2 aa 2024-04-02 14:18:29 +02:00
gitea 00ef92be1f sdae 2024-04-02 14:15:27 +02:00
gitea b8d6c63227 aa 2024-04-02 14:13:55 +02:00
gitea 71cec59cb5 dd 2024-04-02 14:07:36 +02:00
gitea d51b09582b bb 2024-04-02 14:06:39 +02:00
gitea b2ce69d55e bbb 2024-04-02 14:04:53 +02:00
gitea 7c18869b52 aaa 2024-04-02 14:01:50 +02:00
gitea f0c6711fee aaa 2024-04-02 13:59:50 +02:00
gitea fc824d6fff Hopefully last fix 2024-04-02 13:51:06 +02:00
gitea 21db783073 aa 2024-04-02 13:48:21 +02:00
gitea 5c9dd858e0 :) 2024-04-02 13:40:22 +02:00
gitea d54ff9477a dx 2024-04-02 13:37:46 +02:00
gitea 61b929f148 fx 2024-04-02 13:35:54 +02:00
gitea 7ef10cf431 aa 2024-04-02 13:25:28 +02:00
gitea f8f4f1f4aa aa 2024-04-02 13:21:45 +02:00
gitea b4629f7e1a Fix1 2024-04-02 13:18:19 +02:00
gitea aa57a51057 Final version before tests 2024-04-02 13:15:18 +02:00
gitea 17b364524d asdas 2024-04-01 22:35:51 +02:00
gitea bdcf8a5445 as 2024-04-01 22:15:55 +02:00
gitea 46f7a24065 a 2024-04-01 22:12:55 +02:00
gitea d4c07f4efb adsa 2024-04-01 22:11:13 +02:00
gitea ef24e3b768 sasa 2024-04-01 22:10:17 +02:00
gitea 4d26d25efc asa 2024-04-01 22:09:28 +02:00
gitea 86a0057b1e 88 2024-04-01 22:07:33 +02:00
gitea 772961be91 sda 2024-04-01 21:49:59 +02:00
gitea 6e5345ce5b aa 2024-04-01 21:49:18 +02:00
gitea 353aebc78a nn 2024-04-01 21:41:26 +02:00
gitea 974a9e2bc5 asa 2024-04-01 21:31:19 +02:00
gitea d4e33a9dd4 aaa 2024-04-01 21:28:48 +02:00
gitea 04462f01ce as 2024-04-01 21:27:22 +02:00
gitea 121fc0afc0 as 2024-04-01 21:26:00 +02:00
gitea 32dafce2a8 as 2024-04-01 21:24:42 +02:00
gitea fc8140c0fa as 2024-04-01 21:01:13 +02:00
gitea a47a311356 as 2024-04-01 20:59:24 +02:00
gitea face9aef80 qq 2024-04-01 20:58:16 +02:00
gitea 444a208231 as 2024-04-01 20:40:47 +02:00
gitea 10a8765c86 aa 2024-04-01 20:38:34 +02:00
gitea a3fd9369cb asas 2024-04-01 20:24:27 +02:00
gitea 43935e70df aas 2024-04-01 20:13:07 +02:00
gitea b9e6d1e5b6 asas 2024-04-01 20:09:13 +02:00
gitea bfe2a74fb8 bbb 2024-04-01 20:07:27 +02:00
gitea 423c1dde2c Merge branch 'main' of https://github.com/migatu/conjurer 2024-04-01 18:37:18 +01:00
gitea 0ecac0e326 ADd 2024-04-01 18:37:06 +01:00
gitea 0239e8ea7a as 2024-04-01 19:34:53 +02:00
gitea 2caa683b32 asdasdasd 2024-04-01 19:33:04 +02:00
gitea de746ea62d :) 2024-04-01 19:28:02 +02:00
gitea 8497858529 asa 2024-04-01 19:16:34 +02:00
gitea cf5cf37eaa asdasda 2024-04-01 19:14:41 +02:00
gitea 31b898ba40 aa 2024-04-01 19:09:37 +02:00
gitea c11bf7afc9 :) 2024-04-01 19:00:32 +02:00
gitea 79d7888fa5 asa 2024-04-01 18:47:42 +02:00
gitea c8011d1ff1 aa 2024-04-01 18:44:50 +02:00
gitea e141ac4e88 :) 2024-04-01 18:33:31 +02:00
gitea 840a87d85f :) 2024-04-01 18:30:52 +02:00
gitea 71131d4d90 sa 2024-04-01 17:45:51 +02:00
gitea 6133a9d388 as 2024-04-01 17:43:16 +02:00
gitea c51239cd7b aa 2024-04-01 17:38:23 +02:00
gitea e39d17de3a aa 2024-04-01 17:30:22 +02:00
gitea 4b7d566857 aa 2024-04-01 17:23:35 +02:00
gitea bf4c798946 aaa 2024-04-01 17:01:51 +02:00
gitea 3753b3876d as 2024-04-01 13:45:08 +02:00
gitea 01dee2fe08 11 2024-04-01 13:43:09 +02:00
gitea e5cada50cb aa 2024-04-01 13:37:43 +02:00
gitea 036a2b8878 11 2024-04-01 13:33:05 +02:00
gitea 8be5dc56bc xxx 2024-04-01 13:25:47 +02:00
gitea fd2255a8e2 dd 2024-04-01 13:22:51 +02:00
gitea 051850eead ds 2024-04-01 13:17:07 +02:00
gitea f063235839 aa 2024-04-01 13:15:46 +02:00
gitea ee2417ee00 a1 2024-04-01 13:14:00 +02:00
gitea 354afa97f9 aa 2024-04-01 13:13:25 +02:00
gitea ba5be99bce Test 2024-04-01 13:11:33 +02:00
gitea 22d2c8ab39 Suppress 2024-03-30 18:08:32 +01:00
gitea 39c633ff4a Move 2024-03-30 17:24:17 +01:00
gitea d35c6539af Installer 2024-03-30 17:23:05 +01:00
gitea 1361f60d9b aaa 2024-03-30 11:52:06 +01:00
gitea c53b33d597 Serwis 2024-03-30 11:49:12 +01:00
gitea 417518176b 12 2024-03-30 11:41:32 +01:00
gitea 9c074023a1 aa 2024-03-29 23:29:07 +01:00
gitea 96baa19356 xd 2024-03-29 23:22:49 +01:00
gitea e4368f5fd0 asasa 2024-03-29 23:19:57 +01:00
gitea 3ccea3ef9c xd 2024-03-29 23:14:35 +01:00
gitea ca21ac49ae aa 2024-03-29 23:12:37 +01:00
gitea c4368244e8 asa 2024-03-29 23:10:28 +01:00
gitea b2fc71db34 aaa 2024-03-29 23:02:42 +01:00
gitea bbca7dbad7 :) 2024-03-29 23:00:02 +01:00
gitea e4e1e449ed Hejka 2024-03-29 22:55:40 +01:00
gitea 4e040fe70b a 2024-03-29 22:52:29 +01:00
gitea 39c38eab2f xd 2024-03-29 22:49:32 +01:00
gitea ba8209b8af aa 2024-03-29 22:45:44 +01:00
gitea 251c614bdb aaas 2024-03-29 22:39:37 +01:00
gitea f786c19abf 555 2024-03-29 22:33:09 +01:00
gitea 46f51ffee7 aaa 2024-03-29 22:31:58 +01:00
gitea c23a57c368 asa 2024-03-29 22:30:17 +01:00
gitea 673e70d190 aa 2024-03-29 22:28:25 +01:00
gitea c5815f9337 11 2024-03-29 22:26:35 +01:00
gitea 0606397d6a aaa 2024-03-29 22:24:39 +01:00
gitea c9fbc72480 aaa 2024-03-29 22:18:21 +01:00
gitea fe025be64f as 2024-03-29 22:16:53 +01:00
gitea a239af2041 sa 2024-03-29 22:15:38 +01:00
gitea 2d9927e221 async 2024-03-29 22:13:45 +01:00
gitea e824c8e961 asda 2024-03-29 22:11:30 +01:00
gitea 2293f45896 00 2024-03-29 22:10:32 +01:00
gitea cf70b195a0 123 2024-03-29 22:09:09 +01:00
gitea f4f7b038df 123 2024-03-29 22:07:12 +01:00
gitea b7b89d1751 aa 2024-03-29 21:53:09 +01:00
gitea a88fee2e62 as 2024-03-29 21:46:09 +01:00
gitea c22627e3ce ss 2024-03-29 21:45:30 +01:00
gitea 92987fb368 as 2024-03-29 21:44:06 +01:00
gitea 15cc5abfcf a 2024-03-29 21:42:50 +01:00
gitea cbcb08e467 sa 2024-03-29 21:34:04 +01:00
gitea 8817c5097a aa 2024-03-29 21:33:03 +01:00
gitea 3b1eae41f7 1 2024-03-29 21:30:48 +01:00
gitea f1653d23ad RES 2024-03-29 21:29:55 +01:00
gitea 0a118eac0d T 2024-03-29 21:21:09 +01:00
gitea 7483302f07 Hejko 2024-03-29 20:28:53 +01:00
gitea fa35fd9a68 aa 2024-03-29 20:26:09 +01:00
gitea c7fb70325e 11 2024-03-29 20:23:59 +01:00
gitea 3f44ec1b31 AA 2024-03-29 20:22:42 +01:00
gitea 20431cd0c9 test 2024-03-29 20:21:48 +01:00
gitea 3e52f6daac Test 2024-03-29 20:19:21 +01:00
gitea c52b6bdaeb name change 2024-03-29 15:49:03 +01:00
gitea 2ea7cca76c fix 2024-03-29 15:48:35 +01:00
gitea 8fbf233ce6 fax 2024-03-29 15:29:55 +01:00
gitea fcb7aed73a fx 2024-03-29 15:29:33 +01:00
gitea 17d4929b3d Fin part 2024-03-29 15:27:23 +01:00
gitea b4d0eeae13 fx 2024-03-29 15:25:24 +01:00
gitea 52a94e7172 121 2024-03-29 15:21:21 +01:00
gitea 484f424b70 Temp fix 2024-03-29 15:19:46 +01:00
gitea 5613f9e788 as 2024-03-29 15:11:40 +01:00
gitea a849b424b1 aa 2024-03-29 15:07:10 +01:00
gitea d911f9a14d fx 2024-03-29 15:04:51 +01:00
gitea 9057924563 f5 2024-03-29 15:03:47 +01:00
gitea 76c38daaf9 fx4 2024-03-29 15:02:11 +01:00
gitea ae4c7f27bf fix 2024-03-29 15:01:18 +01:00
gitea 59fcfc8760 fx1 2024-03-29 15:00:30 +01:00
gitea eb6c45dd92 Work on deployment 2024-03-29 14:58:46 +01:00
gitea 3875093a98 Merge branch 'main' of https://github.com/migatu/conjurer 2024-03-29 13:53:53 +00:00
gitea 9395a7e096 Deploy.shgit 2024-03-29 13:53:10 +00:00
gitea 6053d94fc5 Merge branch 'main' of https://github.com/migatu/conjurer 2024-03-29 14:52:15 +01:00
gitea 0801fbbb9e Linux conf files 2024-03-29 13:52:10 +00:00
gitea e4c0578723 Install options 2024-03-29 14:52:02 +01:00
gitea 5e8701f518 Waitress 2024-03-29 14:20:27 +01:00
gitea 52440afc56 Minor fix 2 2024-03-29 13:18:04 +01:00
gitea 2b16b2f3e5 Minor 1 2024-03-29 13:15:33 +01:00
gitea b10f60121e Done 2024-03-29 13:13:22 +01:00
gitea 750111b065 Test 20 2024-03-29 13:12:22 +01:00
gitea 2cac362166 Fix 18 2024-03-29 13:11:01 +01:00
gitea 3ac3abe9a9 Test 7 2024-03-29 12:57:43 +01:00
gitea cb9c966f26 Fix 15 2024-03-29 12:56:26 +01:00
gitea e814e4c0ad Test 3 2024-03-29 12:54:50 +01:00
gitea 49de4edbd3 Test 2 2024-03-29 12:53:26 +01:00
gitea 76194d0879 Test 1 2024-03-29 12:53:11 +01:00
gitea adb2b9d409 Fix 15 2024-03-29 12:51:23 +01:00
gitea 247f4cac9d Fix 14 2024-03-29 12:47:55 +01:00
gitea b5a6e1e6e5 Fix 13 2024-03-29 12:45:19 +01:00
gitea e93a9be405 Fix 12 2024-03-29 12:43:43 +01:00
gitea 99c2df52cb Fix 11 2024-03-29 12:41:51 +01:00
gitea 7552c05dac Fix 10 2024-03-29 12:39:25 +01:00
gitea f700e45eef Fix 9 2024-03-29 12:35:53 +01:00
gitea 6a33fd07c5 Fix 2 2024-03-29 10:59:18 +01:00
gitea 9ed78792c6 FIx 1 2024-03-29 10:46:04 +01:00
gitea 745be136f9 Test phase 2 2024-03-29 10:37:13 +01:00
gitea adfda3e6cb Test 8 2024-03-29 09:49:11 +01:00
gitea c7058e64c0 Final test 2024-03-29 09:42:33 +01:00
gitea e47a373aaf Test 5 2024-03-29 09:32:54 +01:00
gitea 5d8db2a801 Test 4 2024-03-29 09:31:41 +01:00
gitea 198ef1f5db Test3 2024-03-29 09:24:59 +01:00
gitea b24caa17d0 Test 2 2024-03-29 09:23:23 +01:00
gitea bb53ea3caf Test 1 2024-03-29 09:20:32 +01:00
gitea 6d07df439c add 2024-03-28 22:10:54 +01:00
gitea 4154012d78 Service 2024-03-28 21:51:58 +01:00
gitea faf1174738 FIx 2024-03-28 21:30:16 +01:00
gitea 85ba775fcf Merge branch 'main' of https://github.com/migatu/conjurer 2024-03-28 21:29:10 +01:00
gitea 48c61c03af modified 2024-03-28 21:27:26 +01:00
gitea 7344fa7335 Merge branch 'main' of https://github.com/migatu/conjurer 2024-03-08 17:00:59 +01:00
gitea 891e0a371e New files for flask services 2024-03-08 17:00:30 +01:00
gitea 3bac0ba83e Nowy lepszy trunk 2024-03-08 16:57:38 +01:00
gitea d3dc994bc1 Additional lines of code 2024-02-21 23:06:18 +01:00
gitea 9b72e641a5 AAA 2024-02-03 09:01:52 +01:00
gitea ff66ea2df6 1 2024-02-02 22:35:19 +01:00
gitea 72a850561d Upgrade gpt model 2024-02-02 22:25:19 +01:00
gitea 1e2555db64 Final 2024-02-01 21:10:13 +01:00
gitea f061377b67 tezz 2024-02-01 21:04:02 +01:00
gitea b36ed8d3f8 1111 2024-02-01 20:48:59 +01:00
gitea d306b85382 fix 2024-02-01 15:56:15 +01:00
gitea 2064a17d83 Library update 2024-02-01 15:40:58 +01:00
gitea 1a1c2ac448 Hejko 2024-01-21 17:51:11 +01:00
gitea 7550cc8ae6 Docstring 2024-01-17 23:11:46 +01:00
gitea df00b12751 Nowy commit 2024-01-17 23:09:21 +01:00
gitea 2c46ef12b9 Update fabryczka 2024-01-16 16:41:42 +01:00
gitea d79683b86f :) 2024-01-06 20:50:11 +01:00
gitea e59ef6f39f :) 2023-10-21 12:04:16 +02:00
gitea 1cb2904636 Fix. Was joking. 2023-10-21 11:24:53 +02:00
gitea 6b4079809d Fix. Last. 2023-10-21 11:11:28 +02:00
gitea 1302420e68 Token amount change 2023-10-21 11:00:24 +02:00
gitea 6029b65e2b Fix 2023-10-21 00:04:32 +02:00
gitea 6d3e74f758 Last (hopefully) fix 2023-10-20 23:22:13 +02:00
gitea 6b9f42aa4a Fix+1 2023-10-20 21:04:03 +02:00
gitea f35fff4f6a Fix 2023-10-20 19:22:08 +02:00
gitea c858e62a81 Fix 2023-10-20 19:19:15 +02:00
gitea 95474155de Fix 2023-10-20 19:17:53 +02:00
gitea 9fce8fcd3d Test 2023-10-20 18:48:14 +02:00
gitea d8e68aab8b Fix tokens 2023-10-20 18:45:03 +02:00
gitea daea2e30b7 Token counter 2023-10-20 18:33:52 +02:00
gitea 66953992f1 Fix 2023-10-20 12:24:22 +02:00
gitea 745e5fa7fb Fix 2023-10-20 12:07:55 +02:00
gitea 78dd826e38 Fix 2023-10-20 11:03:38 +01:00
gitea 19930f6d01 Tiktoken 2023-10-19 14:50:09 +02:00
gitea 3891f843ad Fix 2023-10-19 14:17:25 +02:00
gitea e57a9507c1 ! 2023-10-19 14:15:42 +02:00
gitea 44e071e203 Fix. Another. 2023-10-19 14:13:09 +02:00
gitea f573706077 Fix 2023-10-19 14:05:38 +02:00
gitea d505c116d3 Fix 2023-10-19 14:02:24 +02:00
gitea 0c20b3dc5f FIx 2023-10-19 13:45:11 +02:00
gitea e7aa9575cc Poprawki w gpt 2023-10-19 13:34:58 +02:00
gitea 008556feec Test 2023-10-19 13:11:42 +02:00
gitea 7e53ce47b4 Fix 2023-09-07 10:37:01 +02:00
gitea 662b392b59 Nope. It did not happen 2023-09-07 10:34:50 +02:00
gitea 373da754cc Nowe 2023-09-07 10:28:26 +02:00
gitea d7b547f6f7 Rollback not working 2023-08-30 10:38:59 +02:00
gitea 8d775203e7 Test heartbeat fix 2023-08-30 10:29:54 +02:00
gitea fcd9fdeaa4 Test czy upgrade do długich modeli się udał. 2023-08-29 13:53:59 +02:00
gitea 620d36f915 Fix 2.0 2023-08-29 12:17:04 +02:00
gitea 7b96407556 Fix 2023-08-29 12:12:02 +02:00
gitea 99cdc7bc93 Nope 2023-08-29 12:10:09 +02:00
gitea b7b1c83ed4 Mention conjurer 2023-08-29 12:05:47 +02:00
gitea a3405cffa7 update to gpt-4 2023-08-29 10:53:18 +02:00
gitea cf622dfc68 Test chat gpt4 2023-08-29 10:43:06 +02:00
gitea 84e368b6d3 Hejo 2023-08-29 10:34:53 +02:00
gitea 6e0c5ba172 fix 2023-08-25 23:28:20 +02:00
gitea 532a5f8a30 :) 2023-08-25 13:12:39 +02:00
gitea f70b77bb25 Lunka fix 2023-08-25 11:29:26 +02:00
gitea 5a6aee2884 Lunka i small fix 2023-08-25 11:27:41 +02:00
gitea 935f75ae73 Lilia 2023-08-23 11:22:15 +02:00
gitea dffd5c95d0 Fix with \\b 2023-08-23 11:02:35 +02:00
gitea 1f0325d1cc Add 2023-08-23 10:58:38 +02:00
gitea ecf7dac13b Add Rev 2023-08-23 10:07:11 +02:00
gitea 6be417002c fix 2023-07-21 17:50:11 +02:00
gitea 407b342db2 Fix 2023-07-21 17:44:49 +02:00
gitea 37841f17f9 Fixes 2023-07-21 13:06:12 +02:00
gitea 8f4bd42ff6 More async + responses to config command 2023-07-21 12:45:36 +02:00
gitea c8c3473614 -1 2023-07-20 16:16:41 +02:00
gitea e34f6a3b4c +1 2023-07-20 16:14:03 +02:00
gitea 84feeb1418 Async 2023-07-20 16:11:54 +02:00
gitea 838d17bc92 Async fix 2023-07-20 15:23:57 +02:00
gitea 046e19f839 And even more async 2023-07-19 14:33:16 +02:00
gitea 256586de3e More async 2023-07-19 14:29:56 +02:00
gitea 912e18b93c Async wyszukaj 2023-07-19 14:26:28 +02:00
gitea f8e9dd2554 Improvements 2023-07-19 14:18:17 +02:00
gitea ee11ffcf23 Additional logging 2023-07-19 14:08:28 +02:00
gitea c7dc465d74 Parametryzacja "muzyki mojego ludu" 2023-07-19 13:18:55 +02:00
gitea 7e41934a70 Logging 2023-07-18 09:35:45 +02:00
gitea 071de066a5 Fix 2.6 2023-07-18 09:28:41 +02:00
gitea a6d14aa934 Fix 2 2023-07-18 09:27:12 +02:00
gitea 001dda83fd Fix 1 2023-07-17 18:32:21 +02:00
gitea 8f3ad73e91 Playlist based on chat history 2023-07-17 18:27:15 +02:00
gitea 55aeb77330 Fix fixa 2023-06-23 20:13:00 +02:00
gitea 6dac88a7bd FIx 2023-06-23 20:10:03 +02:00
gitea 03c817dc74 Trunk + mod 2023-06-23 20:07:29 +02:00
gitea fcbb1bb03c Create python-package.yml 2023-06-23 13:12:37 +02:00
gitea 06421e7eb7 Create python-app.yml 2023-06-23 13:12:03 +02:00
gitea f69af3617c Small fixes continued. 2023-06-22 23:25:30 +02:00
gitea b464ebb7aa Small fixes in the paths 2023-06-22 23:19:59 +02:00
gitea 522d2f64b0 Update settings and history 2023-06-22 22:58:22 +02:00
gitea fe65627306 Another fix 2023-06-22 18:45:54 +02:00
gitea 3fd99ce5c4 Fix of metadata loading 2023-06-22 18:44:17 +02:00
gitea d0c59a884c Kolejna poprawka 2023-06-22 18:32:40 +02:00
gitea 6713049431 Wrong encoding in settings.json 2023-06-22 18:27:43 +02:00
gitea 166bd1ee7d Linting is done 2023-06-22 13:30:32 +02:00
gitea 4ee52b95c2 Linting 2023-06-19 23:11:24 +02:00
gitea 83de31f9fc Bugfixy 2023-06-13 18:15:24 +02:00
gitea 144f4b64fb Added playlist display 2023-06-11 11:29:14 +02:00
gitea 952726e7f1 Dodana procedura asynchronicznej generacji iteratora oraz komentarz w
jaki sposob inaczej przerobic fora na asynchroniczny. Przydatne ze
wzgledu na to ze szukajka nadal blokuje heartbeat bota - co skutkuje
warningnami i wyjatkami
2023-06-11 10:12:02 +02:00
gitea d1f242a8ea Reakcje ladacznicy, poprawka na mention w reset the clock 2023-06-10 15:58:24 +02:00
gitea f4e0b02c57 Funkcjonalnosc logowania incydentow w Absinth Eldritch Horror
Hammertimespace Continuum
2023-06-10 14:35:54 +02:00
gitea d5bf1182c9 Mala poprawka na rozmiar plikow pamieci 2023-06-08 14:06:25 +02:00
gitea ee4f39de42 Fixed playlist gen 2023-06-07 00:44:00 +02:00
gitea 42bee72e88 Kurwa bugfix pod windowsa 2023-06-06 12:54:35 +02:00
14 changed files with 111 additions and 35187 deletions
+59 -96
View File
@@ -1,29 +1,27 @@
import asyncio
import json
import logging
import netrc
import re
import logging
import threading
import time
from json.decoder import JSONDecodeError
from queue import Queue
from typing import Callable
from urllib.request import urlopen
from uuid import UUID
import requests
import search_bot
from flask import Flask, jsonify, request
import netrc
import json
import asyncio
from json.decoder import JSONDecodeError
from urllib.request import urlopen
from habanero import Crossref
from waitress import serve
from queue import Queue
import search_bot
import requests
from typing import Callable
from uuid import UUID
NETRC_FILE = r"C:\Users\Activcom.pl\.netrc"
HOST_ADDRESS = "192.168.1.192"
PORT_ADDRESS = 5001
MAIN_BOT_ADDRESS = "http://192.168.1.191:5000"
SEND_RESULTS = "/conjurer"
BDSM_UUID_TEST = "96b7f85a-1142-4908-8986-62a2ea25a147"
BDSM_UUID_TEST = '96b7f85a-1142-4908-8986-62a2ea25a147'
ENCODING = "utf-8"
app = Flask(__name__)
@@ -31,7 +29,6 @@ app = Flask(__name__)
librarian_queue = Queue()
librarian_list = []
class Librarian(object):
def __init__(self, app, query, uuid) -> None:
@@ -52,25 +49,25 @@ class Librarian(object):
async def search_crossref(self, query):
self.app.logger.info("STARTED SEARCH")
result = self.cr.works(query=query, limit=1000)
result = self.cr.works(query = query, limit = 1000)
self.search_result_from_cr.update(result)
self.total = result["message"]["total-results"]
self.fetched += len(result["message"]["items"])
self.logger.info(self.total)
self.total = result['message']['total-results']
self.fetched += len(result['message']['items'])
self.logger.info (self.total)
self.logger.info(self.fetched)
while self.total > self.fetched and self.limit > self.fetched:
result = self.cr.works(query=query, limit=1000)
result = self.cr.works(query = query, limit = 1000)
self.search_result_from_cr.update(result)
self.total = result["message"]["total-results"]
self.fetched += len(result["message"]["items"])
self.logger.info(self.total)
self.total = result['message']['total-results']
self.fetched += len(result['message']['items'])
self.logger.info (self.total)
self.logger.info(self.fetched)
time.sleep(1)
self.app.logger.info("CROSSREF DONE")
# TODO: add to sql with UUID
# sql row - title, doi, author, uuid, last retrieved, is_available
#TODO: add to sql with UUID
#sql row - title, doi, author, uuid, last retrieved, is_available
with open("rr_results.json", "r+", encoding="utf-8") as data_file:
# First we load existing data into a dict.
try:
@@ -79,34 +76,18 @@ class Librarian(object):
file_data = {}
summarized_results = []
self.app.logger.info("REFINE: Removing all derived works from the list")
for item in self.search_result_from_cr["message"]["items"]:
for item in self.search_result_from_cr['message']['items']:
container = "NO"
if "container-title" in item:
container = "YES"
else:
summarized_results.append(
{
"DOI": item["DOI"],
"title": item["title"] if "title" in item else None,
"type": item["type"] if "type" in item else None,
"container": container,
}
)
result = {
self.uuid: {
"total_results": self.search_result_from_cr["message"][
"total-results"
],
"on_page": 1,
"summary": summarized_results,
"results": self.search_result_from_cr["message"]["items"],
}
}
summarized_results.append({"DOI" : item['DOI'], "title": item['title'] if 'title' in item else None,"type": item['type'] if 'type' in item else None, "container": container})
result = {self.uuid : {"total_results": self.search_result_from_cr['message']['total-results'], "on_page" : 1, "summary":summarized_results, "results":self.search_result_from_cr['message']['items']}}
if file_data:
file_data.update(result)
else:
file_data = result
self.app.logger.info("REFINE: Dumping to file")
data_file.truncate(0)
data_file.seek(0)
@@ -115,9 +96,7 @@ class Librarian(object):
async def check_dois_in_local_db(self, doi):
self.app.logger.info("REFINE: Running search in the backend app")
coro = asyncio.to_thread(
search_bot.search_for_doi, doi, self.live_results, self.app.logger
)
coro = asyncio.to_thread(search_bot.search_for_doi, doi, self.live_results, self.app.logger)
result = await coro
return result
@@ -130,34 +109,25 @@ class Librarian(object):
data = response.read()
text = data.decode("utf-8")
for line in text.splitlines():
if re.match(
r".*Unfortunately, Sci-Hub doesn't have the requested document.*",
line,
):
if re.match(r".*Unfortunately, Sci-Hub doesn't have the requested document.*", line):
return False
if m := re.match(
r".*<embed type=\"application.pdf\"\s*src=\"(.*\.pdf)", line
):
if m := re.match(r".*<embed type=\"application.pdf\"\s*src=\"(.*\.pdf)",line):
direct_download_link = "https:" + str(m.group(1))
self.app.logger.info(direct_download_link)
self.app.logger.info (direct_download_link)
return True
return False
async def check_if_exists(self, doi, brute_force=False):
async def check_if_exists(self, doi, brute_force = False):
result = {}
result = await self.check_dois_in_local_db(doi)
if brute_force and not result:
for item in doi:
item_link = "https://sci-hub.se/" + item[0]
tmp = {
"DOI": item["DOI"],
"exists": await self.check_if_exists_brute_force(item_link),
"data": item,
}
tmp = {"DOI" : item["DOI"], "exists" : await self.check_if_exists_brute_force(item_link), "data": item}
result.update(tmp)
return result
async def refine_query(self, unrefined_reqult, brute_force=False):
async def refine_query(self, unrefined_reqult, brute_force = False):
temp = []
refined_result = []
for key in unrefined_reqult:
@@ -165,7 +135,7 @@ class Librarian(object):
self.logger.info(key)
for item in unrefined_reqult[self.uuid]["summary"]:
if item["container"] == "NO" and item["title"]:
if item["container"] == "NO" and item["title"]:
refined_result.append(item)
for item in refined_result:
@@ -179,21 +149,20 @@ class Librarian(object):
refined_result = temp
self.hit = len(refined_result)
return refined_result
# TODO: DOłożyć sprawdzenie czy w rafinowanym pliku już nie mamy częściowego wyniku
#TODO: DOłożyć sprawdzenie czy w rafinowanym pliku już nie mamy częściowego wyniku
async def answer_query(self):
# TODO: DOłożyć sprawdzenie czy w rafinowanym pliku już nie mamy częściowego wyniku tutaj bo zanim w ogóle otworzymy nierafinowany
# Search sql for UUID
# SQL SELECT * FROM RESULTS WHERE UUID = uuid
#TODO: DOłożyć sprawdzenie czy w rafinowanym pliku już nie mamy częściowego wyniku tutaj bo zanim w ogóle otworzymy nierafinowany
#Search sql for UUID
#SQL SELECT * FROM RESULTS WHERE UUID = uuid
self.logger.info(f"Search started {self.uuid}")
uuid_found = False
database = None
query = self.query
with open("cr_results.json", "r+", encoding="utf-8") as cr_file:
# tu logika komunikacji z SQL i cała logika związana z wyszukaniem
# ale tymczasowo plik
#tu logika komunikacji z SQL i cała logika związana z wyszukaniem
#ale tymczasowo plik
try:
database = json.load(cr_file)
database = json.load(cr_file)
except JSONDecodeError:
pass
@@ -206,7 +175,7 @@ class Librarian(object):
database.update(answer)
cr_file.truncate(0)
cr_file.seek(0)
json.dump(database, cr_file)
json.dump(database,cr_file)
self.result = await self.refine_query(answer)
return self.result
else:
@@ -214,14 +183,13 @@ class Librarian(object):
database = answer
cr_file.truncate(0)
cr_file.seek(0)
json.dump(database, cr_file)
json.dump(database,cr_file)
self.result = await self.refine_query(answer)
self.app.logger.info("Refined")
self.done = True
return self.result
# ============================= FLASK INTERNALS===============================
#============================= FLASK INTERNALS===============================
def flask_debug():
"""
The `flask_debug` function starts a Flask application in debug mode without using the reloader.
@@ -230,7 +198,6 @@ def flask_debug():
# trunk-ignore(bandit/B201)
app.run(debug=True, use_reloader=False, host=HOST_ADDRESS, port=PORT_ADDRESS)
def waitress_run():
"""
The `waitress_run` function serves the `app` on host "0.0.0.0"
@@ -238,7 +205,6 @@ def waitress_run():
"""
serve(app, host=HOST_ADDRESS, port=PORT_ADDRESS)
class BackgroundTaskSearch(threading.Thread):
def run(self):
loop = asyncio.new_event_loop() # loop = asyncio.get_event_loop()
@@ -255,7 +221,7 @@ class BackgroundTaskSearch(threading.Thread):
self.app.logger.info("Saving to file")
with open("s_results.json", "r+", encoding="utf-8") as s_file:
try:
database = json.load(s_file)
database = json.load(s_file)
except JSONDecodeError:
pass
if database:
@@ -270,18 +236,17 @@ class BackgroundTaskSearch(threading.Thread):
self.app.logger.info(result)
coroutine = asyncio.to_thread(
requests.post,
f"{MAIN_BOT_ADDRESS}{SEND_RESULTS}",
json=result,
timeout=360,
)
requests.post,
f"{MAIN_BOT_ADDRESS}{SEND_RESULTS}",
json=result,
timeout=360,
)
self.app.logger.info("SENT")
_ = await coroutine
self.app.logger.info("SEND CONFIRMED")
time.sleep(1)
# ==================================SERVER ROUTES==========================================
#==================================SERVER ROUTES==========================================
@app.route("/query", methods=["POST"])
async def query_database():
record = json.loads(request.data)
@@ -289,8 +254,8 @@ async def query_database():
app.logger.info(record["query"])
app.logger.info(record["UUID"])
uuid = record["UUID"]
# TODO: TESTING ONLY======================
uuid = UUID("{12345678-1234-5678-1234-567812345678}")
#TODO: TESTING ONLY======================
uuid = UUID('{12345678-1234-5678-1234-567812345678}')
cl = Librarian(app, record["query"], uuid)
librarian_queue.put(cl)
@@ -302,7 +267,6 @@ async def query_database():
)
return return_data
@app.route("/get_partial_result", methods=["POST"])
async def get_partial():
record = json.loads(request.data)
@@ -318,13 +282,12 @@ async def get_partial():
)
return return_data
# =======================================MAIN===================================================
#=======================================MAIN===================================================
if __name__ == "__main__":
logger = logging.getLogger("conjurer_musician")
logger = logging.getLogger('conjurer_musician')
logger.setLevel(logging.DEBUG)
threads = []
# threads.append(threading.Thread(target=waitress_run))
#threads.append(threading.Thread(target=waitress_run))
threads.append(threading.Thread(target=flask_debug))
bgtask = BackgroundTaskSearch()
bgtask.app = app
@@ -333,7 +296,7 @@ if __name__ == "__main__":
for worker in threads:
try:
logger.info(f"App number: {i}")
i += 1
i+=1
worker.start()
except RuntimeError as e:
logger.error("Exploded")
@@ -1,11 +0,0 @@
[Unit]
Description=Conjurer_musician
After=multi-user.target
[Service]
Type=simple
ExecStart=/home/pi/Conjurer/env/bin/python3 /home/pi/Conjurer/conjurer_musician.py
Restart=on-abort
[Install]
WantedBy=multi-user.target
File diff suppressed because it is too large Load Diff
-48
View File
@@ -1,48 +0,0 @@
let json.parse credentials = file.contents("/home/pi/Conjurer/icecast_credentials.json")
enable_replaygain_metadata()
s1 = replaygain(playlist(reload_mode="watch", "/home/pi/Conjurer/all_playlist.playlist"))
s2 = replaygain(playlist(reload_mode="watch", "/home/pi/Conjurer/priority_queue.playlist"))
s = random(id="randomizer", weights=[7000, 100], [s2, s1])
interactive.harbor(port = 9999)
f = interactive.float("f", description="Frequency", min=0., max=1000.,unit="Hz", 200.)
g = interactive.float("g", description="Gain", min=0., max=20.,unit="dB", 8.)
b = bass_boost(frequency=f, gain=g, s)
s = add([s, b])
a = interactive.float("main_volume", min=0., max=20., 1.)
s = compress.multiband.interactive(bands=3, s)
s = nrj(normalize (s))
s = crossfade(fade_out=3., fade_in=3., duration=5., s)
s = amplify(a,s)
s = blank.skip(max_blank=2., s)
emergency = single("/home/pi/RetroPie/mp3/Youtube/Dr. Peacock - Trip to Ireland [GvrvQTUbUcA].mp3")
radio = fallback(id="switcher",track_sensitive = false, [s, emergency])
handle_metadata = fun (m) -> begin
print(m["title"])
print(m["artist"])
print(m["filename"])
end
radio.on_metadata(handle_metadata)
interactive.persistent("script.params")
log_to_stdout = true
log_to_file = true
logpath = "/home/pi/Conjurer/radio_log.log"
loglevel = 3
# Enable logging on Standard Output and set logging level.
set("log.stdout",log_to_stdout)
set("log.level",loglevel)
# Enable logging to file. See variable: logpath
set("log.file",log_to_file)
set("log.file.path",logpath)
output.file.hls("/tmp/hls",[("mp3-low", %mp3(bitrate=96)), ("mp3-hi", %mp3(bitrate=160))],radio)
output.icecast(%mp3, host="retropie", port=8000,password=credentials.password, icy_metadata="true", mount="mp3-stream", radio)
-14
View File
@@ -1,14 +0,0 @@
[Unit]
Description=radio_conjurer Liquidsoap daemon
After=network.target
Documentation=http://liquidsoap.fm/
[Service]
User=pi
WorkingDirectory=/home/pi/Conjurer/
ExecStart=/home/pi/.opam/4.13.0/bin/liquidsoap /home/pi/Conjurer/radio_conjurer.liq
Restart=always
[Install]
WantedBy=multi-user.target
Alias=radio_conjurer-liquidsoap.service
-6
View File
@@ -1,6 +0,0 @@
#!/bin/bash
cd ./conjurer
git pull
cd ..
cp ./conjurer/conjurer_musician/conjurer_musician.py ./Conjurer
sudo systemctl restart conjurer_musician.service
-6
View File
@@ -1,6 +0,0 @@
#!/bin/bash
cd ./conjurer
git pull
cd ..
cp ./conjurer/conjurer_musician/radio_conjurer.liq ./Conjurer
sudo systemctl restart radio_service.service
@@ -1,23 +1,21 @@
# This Python file uses the following encoding: utf-8
"""
The provided Python script sets up a Flask web server to manage a list of music files, with
functions for rescanning the music folder, updating the music list, and serving the music list via
API endpoints.
"""
import json
import logging
import re
from pathlib import Path
from platform import uname
import threading
import time
from datetime import datetime
from logging import handlers
from pathlib import Path
from platform import uname
from sys import platform
from flask import Flask, jsonify, redirect, request, send_from_directory
import logging
from flask import Flask, jsonify, request
from waitress import serve
HOST_ADDRESS = "192.168.1.15"
PORT_ADDRESS = 5000
if platform in ("linux", "linux2"):
@@ -28,42 +26,24 @@ if platform in ("linux", "linux2"):
NETRC_FILE = "/home/mtuszowski/.netrc"
LOGSTORE = "/home/mtuszowski/conjurer/logs/"
ENCODING = "utf-8"
GRAPHICS_PATH = "/home/mtuszowski/conjurer/Conjurer_graphics/"
else:
LOGFILE = "/home/pi/Conjurer/discord_mus_service.log"
MEMORY_FIVE_SIARA = "/home/pi/Conjurer/pamiec.json"
SYSTEM_GPT_SETTINGS = "/home/pi/Conjurer/system_gpt_settings.json"
MEMORY_FIVE_MUZYKA = "/home/pi/Conjurer/pamiec_muzyki.json"
MUSIC_FOLDER = "/home/pi/RetroPie/mp3/"
SETTINGS_FILE = "/home/pi/Conjurer/settings.json"
NETRC_FILE = "/home/pi/.netrc"
LOGSTORE = "/home/pi/RetroPie/logs/"
ACCIDENT_LOG = "/home/pi/Conjurer/accident_log.json"
ENCODING = "utf-8"
MUSIC_FOLDER = "/home/pi/RetroPie/mp3/"
GRAPHICS_PATH = "/home/pi/RetroPie/Conjurer_graphics/"
DIR_PATH_SADOX = "/home/pi/RetroPie/Fansadox/"
music_file_list = []
def create_playlist():
"""
Reads a JSON file containing a playlist and writes the playlist items to a text file.
The JSON file path is '/home/pi/Conjurer/playlist.json',
and the text file path is '/home/pi/Conjurer/all_playlist.playlist'.
Raises:
JSONDecodeError: If the JSON file cannot be decoded.
"""
with open("/home/pi/Conjurer/playlist.json", "r+", encoding="utf-8") as r_file:
with open(
"/home/pi/Conjurer/all_playlist.playlist", "w", encoding="utf-8"
) as w_file:
try:
playlist = json.load(r_file)
for item in playlist:
w_file.write(item)
w_file.write("\n")
except json.JSONDecodeError:
pass
def rescan():
"""
The `rescan` function logs a message, scans for mp3 files in a specified folder,
@@ -75,14 +55,6 @@ def rescan():
if platform == "win32":
temp_music_file = temp_music_file.replace("/", "\\")
music_file_list.append(temp_music_file)
with open("/home/pi/Conjurer/playlist.json", "r+", encoding="utf-8") as s_file:
database = music_file_list
# self.app.logger.info("DUMPING DATA")
s_file.truncate(0)
s_file.seek(0)
json.dump(database, s_file)
create_playlist()
def thread_rescan():
"""
@@ -91,31 +63,14 @@ def thread_rescan():
"""
logging.info("Starting filesystemupdater")
while True:
time.sleep(60 * 60 * 24)
time.sleep(60*60*24)
logging.info("Rescan triggered")
rescan()
app = Flask(__name__)
# TODO: Odpalić wyszukiwarki w wątkach i dopiero po wszystkim zsumować wyszukiwanie.
def wyszukaj(word_list, how_many, _logger=None, return_to_bot=True):
"""
Searches for music files based on a list of keywords and returns a list of matching files.
Args:
word_list (list): A list of keywords to search for.
how_many (int): The maximum number of matching files to return.
Returns:
list: A list of matching files, sorted by their search weight.
"""
if _logger is None:
fun_logger = logging.getLogger()
else:
fun_logger = _logger
def wyszukaj(word_list, how_many):
logger = logging.getLogger()
return_list = []
search_weight = []
@@ -129,7 +84,7 @@ def wyszukaj(word_list, how_many, _logger=None, return_to_bot=True):
skip_start = 1
for word in word_list[skip_start:]:
token_weight = len(word)
fun_logger.info("Słowo kluczowe: %s", word)
logger.info("Słowo kluczowe: %s", word)
itr = 0
for file in music_file_list:
file = file.split(SEPARATOR_FILE_PATH)
@@ -169,7 +124,6 @@ def wyszukaj(word_list, how_many, _logger=None, return_to_bot=True):
else:
skip = 4
matched_times = 1
# TODO: To do wątków albo for asynchroniczny
for itm in all_words[skip:]:
pingu += 1
pattern = ".*" + word + ".*"
@@ -185,42 +139,26 @@ def wyszukaj(word_list, how_many, _logger=None, return_to_bot=True):
matched_times += 1
itr += 1
fun_logger.info(
"Stworzylem tablice wag zajęło mi to %s", datetime.now() - time_start
)
logger.info("Stworzylem tablice wag zajęło mi to %s", datetime.now() - time_start)
time_start = datetime.now()
item_to_search = max_weight(search_weight)
itr = 0
if item_to_search == 0:
return []
return None
not_found = True
return_list = []
if int(how_many) <= 0:
fun_logger.info("Jeden plik do zagrania")
logger.info("Jeden plik do zagrania")
while not_found:
if search_weight[itr][0] == item_to_search:
return_list.append(search_weight[itr])
if not return_to_bot:
with open(
"/home/pi/Conjurer/priority_queue.playlist", "r+", encoding="utf-8"
) as s_file:
s_file.write(search_weight[itr][1])
break
return return_list
itr += 1
else:
fun_logger.info("Wiele plików do zagrania")
logger.info("Wiele plików do zagrania")
search_weight.sort(key=lambda x: x[0], reverse=True)
return_list.extend(search_weight[: int(how_many)])
if not return_to_bot:
with open(
"/home/pi/Conjurer/priority_queue.playlist", "r+", encoding="utf-8"
) as s_file:
s_file.truncate(0)
for item in return_list:
s_file.write(item[1] + "\n")
return return_list
return return_list
def max_weight(lista):
"""
@@ -250,47 +188,6 @@ def remove_characters(string, character):
return string.replace(character, "")
@app.route("/stream", methods=["GET"])
def stream_music():
"""
The function `get_music_list` returns a JSON object containing a list of music files.
:return: A JSON response containing a key "music_file_list" with the value of the variable
`music_file_list`.
"""
return send_from_directory("/tmp/hls", "stream.m3u8")
@app.route('/<string:file_name>')
def stream(file_name):
video_dir = '/tmp/hls'
return send_from_directory(video_dir, file_name)
@app.route("/stream_mp3", methods=["GET"])
def stream_music_mp3():
"""
The function `get_music_list` returns a JSON object containing a list of music files.
:return: A JSON response containing a key "music_file_list" with the value of the variable
`music_file_list`.
"""
return redirect("http://www.example.com", code=302)
@app.route("/clear_pr_pls", methods=["GET"])
def clear_pr_pls():
"""
The function `get_music_list` returns a JSON object containing a list of music files.
:return: A JSON response containing a key "music_file_list" with the value of the variable
`music_file_list`.
"""
with open(
"/home/pi/Conjurer/priority_queue.playlist", "w", encoding="utf-8"
) as s_file:
s_file.truncate(0)
return_data = jsonify(isError=False, message="Success", statusCode=200, data=[])
return return_data, 200
@app.route("/mp3", methods=["GET"])
def get_music_list():
"""
@@ -321,7 +218,6 @@ def update_music_list():
)
return return_data
@app.route("/get_music", methods=["POST"])
def look_for_playlist():
"""
@@ -338,31 +234,7 @@ def look_for_playlist():
app.logger.info(record["lista_slow"])
app.logger.info(record["UUID"])
app.logger.info(record["dlugosc_plejlisty"])
return_data = wyszukaj(record["lista_slow"], record["dlugosc_plejlisty"], app.logger, True)
return_data = (
jsonify(isError=False, message="Success", statusCode=200, data=return_data),
200,
)
return return_data
@app.route("/add_to_priority", methods=["POST"])
def add_to_priority():
"""
The function `update_music_list` receives a POST request with a JSON payload, logs the received
item, adds it to a music file list, and returns a success message along with the updated record.
:return: The function `update_music_list` is returning a tuple containing a JSON response and a
status code. The JSON response includes keys `isError`, `message`, `statusCode`, and `data`,
with values indicating the success of the operation and the data that was
received and added to the `music_file_list`.
The status code returned is 200, indicating a successful response.
"""
record = json.loads(request.data)
app.logger.info(record)
app.logger.info(record["lista_slow"])
app.logger.info(record["UUID"])
app.logger.info(record["dlugosc_plejlisty"])
return_data = wyszukaj(record["lista_slow"], record["dlugosc_plejlisty"], app.logger, False)
return_data = wyszukaj(record["lista_slow"],record["dlugosc_plejlisty"])
return_data = (
jsonify(isError=False, message="Success", statusCode=200, data=return_data),
@@ -379,7 +251,6 @@ def flask_debug():
# trunk-ignore(bandit/B201)
app.run(debug=True, use_reloader=False, host=HOST_ADDRESS, port=PORT_ADDRESS)
def waitress_run():
"""
The `waitress_run` function serves the `app` on host "0.0.0.0"
@@ -387,27 +258,12 @@ def waitress_run():
"""
serve(app, host=HOST_ADDRESS, port=PORT_ADDRESS)
if __name__ == "__main__":
logger = logging.getLogger("conjurer_musician")
logger = logging.getLogger('conjurer_musician')
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter(
"%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
handler = handlers.RotatingFileHandler(
filename=LOGFILE,
encoding=ENCODING,
mode="a",
maxBytes=6 * 1024 * 1024,
backupCount=6,
)
handler.setFormatter(formatter)
logger.addHandler(handler)
rescan()
logger.info("Started")
threads = []
#threads.append(threading.Thread(target=flask_debug))
threads.append(threading.Thread(target=waitress_run))
threads.append(threading.Thread(target=thread_rescan))
@@ -416,3 +272,5 @@ if __name__ == "__main__":
for worker in threads:
worker.join()
#TODO: Inne pliki - sadox, dokumenty naukowe itp.
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=Conjurer_musician
After=multi-user.target
[Service]
Type=simple
ExecStart=/home/pi/Conjurer-service/conjurer/file_webservice/bin/python3 /home/pi/Conjurer-service/conjurer/file_webservice/conjurer_musician.py
Restart=on-abort
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,11 @@
#!/bin/bash
python3 -m venv /home/pi/Conjurer-service/conjurer/file_webservice
source ./bin/activate
./bin/python3 -m pip install --upgrade pip
./bin/python3 -m pip install -r requirements_musician.txt
deactivate
sudo cp ./conjurer_musician.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start conjurer_musician.service
sudo systemctl enable conjurer_musician.service
+2 -6
View File
@@ -1,9 +1,5 @@
#!/bin/bash
cd /home/pi
mdkir Conjurer
cd Conjurer
python3 -m venv /home/pi/Conjurer/env
cp /home/pi/conjurer/requirements_bot.txt /home/pi/Conjurer/
source ./env/bin/activate
./env/bin/python3 -m pip install --upgrade pip
./env/bin/python3 -m pip install -r requirements_bot.txt
@@ -12,5 +8,5 @@ sed -i '1i\import shutil' ./env/lib/python3.11/site-packages/spotify_dl/youtube.
deactivate
sudo cp ./conjurer.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start conjurer.service
sudo systemctl enable conjurer.service
sudo systemctl start conjurer_musician.service
sudo systemctl enable conjurer_musician.service
-26
View File
@@ -1,26 +0,0 @@
#!/bin/bash
cd /home/pi
mkdir Conjurer
cd Conjurer
python3 -m venv /home/pi/Conjurer/env
source /home/pi/Conjurer/env/bin/activate
cp /home/pi/conjurer/conjurer_musician/requirements_musician.txt /home/pi/Conjurer/
cp /home/pi/conjurer/conjurer_musician/conjurer_musician.py /home/pi/Conjurer/
cp /home/pi/conjurer/conjurer_musician/radio_conjurer.liq /home/pi/Conjurer/
touch /home/pi/Conjurer/discord_mus_service.log
touch /home/pi/Conjurer/all_playlist.txt
touch /home/pi/Conjurer/playlist.json
touch /home/pi/Conjurer/priority_queue.playlist
touch /home/pi/Conjurer/radio_log.log
./env/bin/python3 -m pip install --upgrade pip
./env/bin/python3 -m pip install -r requirements_musician.txt
deactivate
sudo cp /home/pi/conjurer/conjurer_musician/conjurer_musician.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start conjurer_musician.service
sudo systemctl enable conjurer_musician.service
sudo cp /home/pi/conjurer/conjurer_musician/radio_service.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start radio_service.service
sudo systemctl enable radio_service.service