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
5 changed files with 156 additions and 261 deletions
+141 -200
View File
@@ -46,12 +46,7 @@ from spotify_dl import youtube as youtube_download
from communication_subroutine import comm_subroutine, IN_COMM_Q, OUT_COMM_Q
# *=========================== Classes definition
# The above code is defining a TypedDict called `Music_Config` in Python. This TypedDict has three
# keys: "ctx" which is an optional string, "queue" which is a list of strings, and "requester" which
# is a list of strings. This TypedDict is used to define the structure of a dictionary that should
# have these specific keys and value types.
Music_Config = TypedDict(
"Music_Config",
{
@@ -63,10 +58,6 @@ Music_Config = TypedDict(
class QueryControl:
"""
This class `QueryControl` is used to manage queries with information about the author, UUID,
content, logger, context, and replies.
"""
def __init__(self, query_author, query_uuid, query_content, uplogger, ctx) -> None:
self.author = query_author
self.uuid = query_uuid
@@ -79,95 +70,6 @@ class QueryControl:
)
self.replies = []
class MusicFileList(object):
"""
The `MusicFileList` class manages a list of music files, with the ability to refresh the list from a
file service or local directory and update the list with new items.
"""
def __init__(self, uplogger) -> None:
self.music_file_list = []
self.file_service_active = False
self.logger = uplogger
self.logger.info("Created Playlist organizer class")
def refresh_file_list(self):
"""
The `refresh_file_list` function attempts to connect to a file service to retrieve a list of music
files, and if unsuccessful, it populates the list by scanning a local directory for .mp3 files.
"""
try:
self.logger.info("Attempt to connect to file service")
response = requests.get(f"{FILE_SERVICE_ADDRESS}{GET_MP3}", timeout=360)
self.music_file_list = response.json()["music_file_list"]
self.file_service_active = True
except requests.exceptions.RequestException as e:
for mp3_item in Path.glob(Path(MUSIC_FOLDER), "**/*.mp3"):
temp_music_file = mp3_item.as_posix()
if platform == "win32":
temp_music_file = temp_music_file.replace("/", "\\")
self.music_file_list.append(temp_music_file)
self.file_service_active = False
self.logger.error(e.strerror)
self.logger.error("Service Unavailable")
def get_file_list(self):
"""
The `get_file_list` function returns the list of music files stored in the object.
:return: The `music_file_list` attribute is being returned.
"""
return self.music_file_list
def update_file_list(self, item):
"""
The `update_file_list` function appends an item to a music file list and sends a POST request with
the item data to a file service address.
:param item: The `item` parameter in the `update_file_list` method is the file that you want to add
to the `music_file_list` attribute of the class instance. It is then sent as a JSON payload in a
POST request to a file service address along with the endpoint `SEND_MP3`
"""
self.music_file_list.append(item)
post_data = {"item": str(item)}
requests.post(f"{FILE_SERVICE_ADDRESS}{SEND_MP3}", json=post_data, timeout=360)
class DoSearchView(discord.ui.View):
def __init__(self, _uuid, result_list, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.uuid = _uuid
self.result_list = result_list
@discord.ui.button(
label="Nastepna strona", style=discord.ButtonStyle.primary, row=0
)
async def next_callback(self, interaction, button):
# emoji = await ctx.guild.fetch_emoji(id)
# button.emoji=1102174413887111189
logger.info("Pressed")
await interaction.response.edit_message(
content="You clicked the button!"
) # Send a message when the button is clicked
@discord.ui.button(label="Wyszukaj wiecej", style=discord.ButtonStyle.danger, row=0)
async def reset_callback(self, interaction, button):
# emoji = await ctx.guild.fetch_emoji(id)
# button.emoji=1102174413887111189
logger.info("Pressed")
await interaction.response.edit_message(
content="You clicked the button!"
) # Send a message when the button is clicked
@discord.ui.button(
label="Poprzednia Strona", style=discord.ButtonStyle.primary, row=0
)
async def perv_callback(self, interaction, button):
# emoji = await ctx.guild.fetch_emoji(id)
# button.emoji=1102174413887111189
logger.info("Pressed")
await interaction.response.edit_message(
content="You clicked the button!"
) # Send a message when the button is clicked
# *=========================================== Predefines
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
@@ -191,8 +93,6 @@ FILE_SERVICE_ADDRESS = "http://192.168.1.15:5000"
GET_MP3 = "/mp3"
SEND_MP3 = "/update_mp3"
GET_PLAYLIST = "/get_music"
ADD_TO_PRIO_PLAYLIST = "/add_to_priority"
CLEAR_PRIO = "/clear_pr_pls"
LIBRARIAN_SERVICE_ADDRESS = "http://192.168.1.192:5001"
SEND_QUERY = "/query"
TIME_BETWEEN_CALLS = 100000
@@ -293,6 +193,60 @@ logger.info("Playlist generation")
# *=========================================== Load Data files
class MusicFileList(object):
"""
The `MusicFileList` class manages a list of music files, with the ability to refresh the list from a
file service or local directory and update the list with new items.
"""
def __init__(self, uplogger) -> None:
self.music_file_list = []
self.file_service_active = False
self.logger = uplogger
self.logger.info("Created Playlist organizer class")
def refresh_file_list(self):
"""
The `refresh_file_list` function attempts to connect to a file service to retrieve a list of music
files, and if unsuccessful, it populates the list by scanning a local directory for .mp3 files.
"""
try:
self.logger.info("Attempt to connect to file service")
response = requests.get(f"{FILE_SERVICE_ADDRESS}{GET_MP3}", timeout=360)
self.music_file_list = response.json()["music_file_list"]
self.file_service_active = True
except requests.exceptions.RequestException as e:
for mp3_item in Path.glob(Path(MUSIC_FOLDER), "**/*.mp3"):
temp_music_file = mp3_item.as_posix()
if platform == "win32":
temp_music_file = temp_music_file.replace("/", "\\")
self.music_file_list.append(temp_music_file)
self.file_service_active = False
self.logger.error(e.strerror)
self.logger.error("Service Unavailable")
def get_file_list(self):
"""
The `get_file_list` function returns the list of music files stored in the object.
:return: The `music_file_list` attribute is being returned.
"""
return self.music_file_list
def update_file_list(self, item):
"""
The `update_file_list` function appends an item to a music file list and sends a POST request with
the item data to a file service address.
:param item: The `item` parameter in the `update_file_list` method is the file that you want to add
to the `music_file_list` attribute of the class instance. It is then sent as a JSON payload in a
POST request to a file service address along with the endpoint `SEND_MP3`
"""
self.music_file_list.append(item)
post_data = {"item": str(item)}
requests.post(f"{FILE_SERVICE_ADDRESS}{SEND_MP3}", json=post_data, timeout=360)
music_file_list = []
music_file_list = MusicFileList(logger)
music_file_list.refresh_file_list()
@@ -329,8 +283,6 @@ for key in word_reactions:
word_reactions[key][2] = datetime.now()
logger.info("Done")
# *=========================================== Create Client
logger.info("Creating discord bot")
client = commands.Bot(intents=intents, command_prefix="$")
@@ -390,8 +342,8 @@ async def on_message(message):
if isinstance(message.channel, discord.DMChannel):
channel = client.get_channel(1064888712565100614)
await channel.send("Słyszałem ja żem że: " + message.content)
return
channel = message.channel
else:
channel = message.channel
await client.process_commands(message)
message.content = message.content.lower()
@@ -730,40 +682,10 @@ async def check_music():
@tasks.loop(seconds=3)
# trunk-ignore(pylint/R0915)
async def check_data_q():
channel = client.get_channel(1062047367337095268)
try:
data = IN_COMM_Q.get(block=False)
entries = []
if data.stop:
searcher = data.author
ctx = data.ctx
query = data.content
l_p = 1
for doi in data.entries:
logger.info(doi)
desc = data.entries[doi]
title = desc['Title'][0]
entries.append(f"{l_p}. {title} pod linkiem https://www.sci-hub.se/{doi} i jest to {desc['type']}\n")
l_p+=1
message = '*Z podłogi wysuwa się winda na książki*'
message += f' Dzielny poszukiwaczu @{searcher} w odpowiedzi na twoje zapytanie {query}'
message += 'nasza biblioteka służy Ci odpowiedzią. Przy dźwięku fanfar winda się otwiera a w środku '
if len(entries)<1:
message += "niestety nie ma nic"
elif len(entries)>=1 and len(entries)<5:
message += " znajduje się coś:\n"
for item in entries:
message+=item
else:
message+= " znajduje się cholernie dużo:\n"
for item in entries:
message+=item
if len(message) > 1500:
await ctx.send(message)
message = ""
await ctx.send(message)
#Kept for sentimental reasons
#await ctx.send(f"O. A tak będzie wyglądało coś ciekawego w przyszłości: {data}")
await channel.send(f"O. A tak będzie wyglądało coś ciekawego w przyszłości: {data}")
except Empty:
pass
@@ -1125,10 +1047,8 @@ async def get_file(ctx, source, link):
dir_path = None
item_type, item_id = spotify.parse_spotify_url(link)
if item_id:
coro = asyncio.to_thread(spotify.fetch_tracks, args=(spotify_ctrl, item_type, link))
file_list = await coro
coro = asyncio.to_thread(spotify.get_item_name, args=(spotify_ctrl, item_type, item_id))
directory_name = await coro
file_list = spotify.fetch_tracks(spotify_ctrl, item_type, link)
directory_name = spotify.get_item_name(spotify_ctrl, item_type, item_id)
url_data = {"urls": []}
url_dict = {}
url_dict["save_path"] = Path(
@@ -1355,7 +1275,6 @@ async def wyszukaj(ctx, how_many=0, slowa_kluczowe=None):
json=jrequest,
timeout=360,
)
return_data = await coroutine
if not return_data.status_code == 200:
await ctx.send("Wołaj szefa - coś się wyjebało")
@@ -1781,63 +1700,6 @@ async def zagraj_mi_kawalek(ctx):
"Obawiam się że nie mogę nic znaleźć u siebie. Spróbuj komendy '$dej_co_ze_spotifaja' jeśli masz link"
)
@client.hybrid_command(
name="dodaj_do_ulubionych",
description="Dodaje do listy ulubionych w radiu",
guild=discord.Object(id=664789470779932693),
)
async def dodaj_do_ulubionych(ctx):
"""
Generate a playlist in queue. First word in this command shall be int defining length of the playlist.
Rest of the line are search terms.
:param ctx: ctx stands for "context" and is a parameter commonly used in Discord.py commands. It
represents the context in which the command was invoked, including information such as the message,
the channel, the server, and the user who invoked the command. This parameter is required in all
Discord.py commands
"""
async with ctx.typing():
logger.info("Zaczynam szukać timestamp %s", datetime.now())
dlugosc_playlisty = ctx.message.content.split()[1]
word_list = ctx.message.content.split()
jrequest = {
"lista_slow": word_list,
"dlugosc_plejlisty": dlugosc_playlisty,
"UUID": str(uuid.uuid4()),
}
coroutine = asyncio.to_thread(
requests.post,
f"{FILE_SERVICE_ADDRESS}{ADD_TO_PRIO_PLAYLIST}",
json=jrequest,
timeout=360,
)
_ = await coroutine
@client.hybrid_command(
name="wyczysc_ulubione",
description="Czysci liste ulubionych w radiu",
guild=discord.Object(id=664789470779932693),
)
async def wyczysc_ulubione(ctx):
"""
Generate a playlist in queue. First word in this command shall be int defining length of the playlist.
Rest of the line are search terms.
:param ctx: ctx stands for "context" and is a parameter commonly used in Discord.py commands. It
represents the context in which the command was invoked, including information such as the message,
the channel, the server, and the user who invoked the command. This parameter is required in all
Discord.py commands
"""
async with ctx.typing():
coroutine = asyncio.to_thread(
requests.post,
f"{FILE_SERVICE_ADDRESS}{CLEAR_PRIO}",
json={},
timeout=360,
)
_ = await coroutine
@client.hybrid_command(
name="zrob_mi_plejliste",
@@ -2203,6 +2065,44 @@ async def parametry_muzyki_mego_ludu(
logger.info(exce)
class DoSearchView(discord.ui.View):
def __init__(self, uuid, result_list, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.uuid = uuid
self.result_list = result_list
@discord.ui.button(
label="Nastepna strona", style=discord.ButtonStyle.primary, row=0
)
async def next_callback(self, interaction, button):
# emoji = await ctx.guild.fetch_emoji(id)
# button.emoji=1102174413887111189
logger.info("Pressed")
await interaction.response.edit_message(
content="You clicked the button!"
) # Send a message when the button is clicked
@discord.ui.button(label="Wyszukaj wiecej", style=discord.ButtonStyle.danger, row=0)
async def reset_callback(self, interaction, button):
# emoji = await ctx.guild.fetch_emoji(id)
# button.emoji=1102174413887111189
logger.info("Pressed")
await interaction.response.edit_message(
content="You clicked the button!"
) # Send a message when the button is clicked
@discord.ui.button(
label="Poprzednia Strona", style=discord.ButtonStyle.primary, row=0
)
async def perv_callback(self, interaction, button):
# emoji = await ctx.guild.fetch_emoji(id)
# button.emoji=1102174413887111189
logger.info("Pressed")
await interaction.response.edit_message(
content="You clicked the button!"
) # Send a message when the button is clicked
@client.hybrid_command(
name="wyszukaj_linki_do_dokumentow",
description="Szuka linkow doi w bazie crossref i podaje linki do scihuba",
@@ -2211,8 +2111,8 @@ async def parametry_muzyki_mego_ludu(
async def wyszukaj_linki_do_dokumentow(ctx):
query = ctx.message.content
query_uuid = uuid.uuid4()
#TODO: TESTING ONLY!!
#query_uuid = uuid.UUID('{12345678-1234-5678-1234-567812345678}')
# query_uuid = "test"
# 3 wyslij Librariana
json_query = {"UUID": str(query_uuid), "query": str(query)[30:], "page": 1}
coroutine = asyncio.to_thread(
requests.post,
@@ -2245,6 +2145,46 @@ async def wyszukaj_linki_do_dokumentow(ctx):
await ctx.send(f"No dobra poszło. Zapamiętaj proszę {query_uuid} - to identyfikator twojego zapytania. Jesteś {queue_size} w kolejce."+
" Zapytania obsługuje algorytm zasilany czterema chomikami zapierdalającymi w kołowrotku - więc wyniki najwcześniej za kilka godzi - ale mogą być też dni.")
'''
async def wyswietl_wyniki_wyszukiwania(ctx):
# 4 zwroc 4 wyniki od librariana
# 5 przyciski przy każdym wierszu pozwalają sprawdzić czy plik istnieje na scihubie - jeśli tak podaje link do sciagniecia
# 6 ostatni wiersz to dalej, wróć, skasuj, zaciagnij kolejne wyniki (jeśli jest ich więcej niż 1000)
result_view = DoSearchView(
uuid=str(query_uuid), result_list=query_response.json()["data"]
)
resulttab = []
resultlink = []
hit, fetched, total, _ = query_response.json()["data"][0]
answer = query_response.json()["data"][1]
for item in answer:
resulttab.append(str(item["title"]))
item_link = "https://sci-hub.se/" + str(item["DOI"])
resultlink.append(item_link)
logger.info(len(resulttab))
for i in range(0, min(4, len(resulttab))):
logger.info(i)
logger.info(resulttab[i])
logger.info(resultlink[i])
url = resultlink[i]
logger.info(url)
temp_label = str(resulttab[i])
temp_label = temp_label.strip("[']")
result_view.add_item(
discord.ui.Button(label=str(temp_label[0:79]), row=i + 1, url=url)
)
labelka = (
"Wyniki wyszukiwania dla: "
+ str(query)[30:]
+ f"\nWszystkich {total} sprawdzonych: {fetched} znalezionych: {hit} "
) # ile znaleziono artykułów w ogóle, ile zostało po refine
await ctx.send(
labelka, view=result_view
) # Send a message with our View class that contains the button
'''
@client.hybrid_command(
name="krecimy_pornola",
@@ -2283,6 +2223,7 @@ async def krecimy_pornola(ctx):
# *================================== Run
if __name__ == "__main__":
# TODO: wpakowac kondzia w wątki odpalic asynchronicznie rownolegle z flaskiem do sterowania nim
logger.info("Starting discord bot")
threads = []
logger.info("Starting discord bot: Creating threads")
View File
View File
View File
+15 -61
View File
@@ -1,7 +1,6 @@
import logging
import threading
import json
import time
from queue import Queue, Empty
from flask import Flask, jsonify, request
from waitress import serve
@@ -10,34 +9,28 @@ HOST_ADDRESS = "192.168.1.191"
PORT_ADDRESS = 5000
OUT_COMM_Q = Queue()
IN_COMM_Q = Queue()
awaiting_q = []
incoming_q = Queue()
internal_q = Queue()
app = Flask(__name__)
@app.route("/conjurer", methods=["POST"])
def answer_external_command():
"""
The function `answer_external_command` logs the request data, loads the data as JSON, logs the
record, and then puts the record into an incoming queue before returning a success message.
:return: The function `answer_external_command()` is returning a JSON response with the message
"SUCCESS".
"""
app.logger.info(request)
record = json.loads(request.data)
app.logger.info(record)
app.logger.info("DATA RECEIVED")
incoming_q.put(record)
while True:
try:
q_data = internal_q.get(block=False)
except Empty:
break
if q_data.uuid in record:
pass
return jsonify("SUCCESS")
@app.route("/conjurer", methods=["GET"])
def check_alive():
"""
The function "check_alive" returns a JSON response with the message "ALIVE" when the "/conjurer"
route is accessed via a GET request.
:return: The code snippet is a Flask route that listens for GET requests to the "/conjurer"
endpoint. When a GET request is made to this endpoint, the function check_alive() is called, which
returns a JSON response with the message "ALIVE".
"""
return jsonify("ALIVE")
def flask_debug(_logger):
@@ -59,58 +52,19 @@ def waitress_run(_logger):
serve(app, host=HOST_ADDRESS, port=PORT_ADDRESS)
def scan_queue(_logger):
"""
The function `scan_queue` reads data from a queue, logs it, and appends it to another queue.
:param _logger: The `_logger` parameter is typically an instance of a logging object that is used to
record and store log messages. It is commonly used to track the flow of the program, record errors,
and provide information for debugging purposes. In this code snippet, the `_logger` object is used
to log the
"""
while True:
data = OUT_COMM_Q.get()
_logger.info(data)
awaiting_q.append(data)
def scan_incoming(_logger):
"""
The `scan_incoming` function continuously checks for incoming data, processes it, and logs when data
is found.
:param _logger: The `_logger` parameter in the `scan_incoming` function is a logger object that is
used to log messages or information during the execution of the function. It is typically used for
debugging, monitoring, or tracking the flow of the program. In this case, the `_logger` is being
used
"""
while True:
try:
answer = incoming_q.get(block=False)
_logger.info("DATA FOUND")
for record in awaiting_q:
if record.uuid in answer.keys():
record.stop = True
record.entries = answer[record.uuid]
IN_COMM_Q.put(record)
except Empty:
time.sleep(1)
internal_q.put(data)
query_list.append(data)
def comm_subroutine(logger):
"""
The `comm_subroutine` function starts multiple threads to run different tasks concurrently.
:param logger: The `logger` parameter in the `comm_subroutine` function is an instance of a logger
object that is used for logging messages at various levels (e.g., debug, info, warning, error). In
the provided code snippet, the logger is used to log messages at the "info" level
"""
#logger.setLevel(logging.DEBUG)
logger.info("Started")
threads = []
#threads.append(threading.Thread(target=flask_debug, args=(logger,)))
threads.append(threading.Thread(target=waitress_run, args=(logger,)))
threads.append(threading.Thread(target=flask_debug, args=(logger,)))
#threads.append(threading.Thread(target=waitress_run, args=(logger,)))
threads.append(threading.Thread(target=scan_queue,args=(logger,)))
threads.append(threading.Thread(target=scan_incoming,args=(logger,)))
for worker in threads:
worker.start()