Giter Club home page Giter Club logo

monorepo's Introduction

monorepo's People

Contributors

burnysc2 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

monorepo's Issues

Transcriber: Fix TypeError in messages_iter

Traceback (most recent call last):
  File "/app/src/telegram_downloader.py", line 583, in <module>
    asyncio.run(main(), debug=False)
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/app/src/telegram_downloader.py", line 556, in main
    await parse_channel_messages()
  File "/app/src/telegram_downloader.py", line 428, in parse_channel_messages
    async for message in messages_iter:
  File "/root/.cache/pypoetry/virtualenvs/transcriber-backend-9TtSrW0h-py3.10/lib/python3.10/site-packages/pyrogram/methods/messages/get_chat_history.py", line 101, in get_chat_history
    messages = await get_chunk(
  File "/root/.cache/pypoetry/virtualenvs/transcriber-backend-9TtSrW0h-py3.10/lib/python3.10/site-packages/pyrogram/methods/messages/get_chat_history.py", line 49, in get_chunk
    return await utils.parse_messages(client, messages, replies=0)
  File "/root/.cache/pypoetry/virtualenvs/transcriber-backend-9TtSrW0h-py3.10/lib/python3.10/site-packages/pyrogram/utils.py", line 101, in parse_messages
    parsed_messages.append(await types.Message._parse(client, message, users, chats, replies=0))
  File "/root/.cache/pypoetry/virtualenvs/transcriber-backend-9TtSrW0h-py3.10/lib/python3.10/site-packages/pyrogram/types/messages_and_media/message.py", line 590, in _parse
    parsed_message.pinned_message = await client.get_messages(
  File "/root/.cache/pypoetry/virtualenvs/transcriber-backend-9TtSrW0h-py3.10/lib/python3.10/site-packages/pyrogram/methods/messages/get_messages.py", line 115, in get_messages
    r = await self.invoke(rpc, sleep_threshold=-1)
...
  File "/root/.cache/pypoetry/virtualenvs/transcriber-backend-9TtSrW0h-py3.10/lib/python3.10/site-packages/pyrogram/connection/transport/tcp/tcp_abridged_o.py", line 61, in send
    payload = await self.loop.run_in_executor(pyrogram.crypto_executor, aes.ctr256_encrypt, data, *self.encrypt)
TypeError: Value after * must be an iterable, not NoneType

Except / ignore the TypeError in

Remove svelte frontends

I decided to switch to htmx to make my life easier as a backend dev. This means giving up on frontend frameworks and doing server side rendering instead.

Rewrite transcriber to use thread executor instead

Affected folders: https://github.com/BurnySc2/monorepo/tree/develop/transcribe_website/transcriber_backend

Idea:
https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor
https://github.com/BurnySc2/monorepo/blob/daab0f49399bd98bb8ea9b1a15877dcf4b7703fb/python_examples/examples/other/multithreading_example_02.py

Why?
Easier to read and use than the asyncio syntax.
Instead of async for ... we just use for loops
Instead of async with semaphore we just use with semaphore
Instead of await function() we just call the function
Instead of asyncio.create_task(func) we just submit a new function call to the executor, which will only leave the with statement when all tasks are completed.
Should be easier to test/mock functions

Replay comparer - feature ideas

From a discussion I had:

  • Resource collection (shows late worker transfers or late expanding)
  • Comparison army lost vs active army
  • Comparison between building-start-time, or building count, e.g. when was 6th gateway added
  • Comparison between upgrade-finished-time (chrono boost)
  • Spending (Econ, Tech, Army)
  • Comparison of unit count
  • Save function for ideal replays in local storage if possible

Add descriptions for each project

Add a README.md file for each project and list the following things:

  • what is this project for
  • how to start and run the project
  • how to maintain/update the project
  • how is it structured, what tools does it use or depend on

Add SC2 Stream Scripts for Twitch

This repo contains match info and build order overlays
Rewrite them to use htmx to connect to the SC2 API

It was attempted to rewrite them in svelte here https://github.com/BurnySc2/monorepo/blob/7ba9ea45b71944ac97bba559e874854ec98ce93c/supabase_stream_scripts/src/pages/BuildOrder.svelte

Make them available for:

Add multiple modules:

  • Build order overlay (Choice with chat interaction?)
  • Match info
  • Match history
  • Betting system with Chat
  • Title updater

Join twitch chat anonymously

Change the following (and other lines):

class TwitchIrcBot(commands.Bot): # pyre-fixme[11]
def __init__(self, loop):
super().__init__(
token=os.getenv("TWITCH_OAUTH_TOKEN"),
prefix="!",
initial_channels=["burnysc2"],
loop=loop,
)

Join irc chat anonymously instead with justinfanXXX where XXX is a number
https://discuss.dev.twitch.com/t/anonymous-connection-using-justinfan/2046
https://gist.github.com/skntxyz/833dd97620d44c345520
https://discuss.dev.twitch.com/t/bot-cant-send-messages-to-other-channel/30021/6

Write frontend tests against supabase

In bored_gems project I plan on using supabase. However I need to check if my application works but implementing some kind of integration tests, which means:

  • start dev server (or build and "preview")
  • go to locally hosted url
  • registering a user via email (random username and password so it doesnt collide with existing users in db)
  • logging in with that user
  • creating a game in the game lobby
  • repeat with 2nd user, join the game lobby
  • play a simple game e.g. tic tac toe
  • register/notice that the game has completed
  • mark test as success

This way I can assure that at least basics of the application still works. However this poses a few issues:

  • How to ensure that the test doesnt fail because of a username clash? Catch error on registering
  • How to ensure that the supabase database models are up to date? Use prisma to get type safety and intellisense for the db model. How to integrate this into the supabase client?
  • How to ensure that tests does not collide with production data? Add a new column in db with "DEV=true" for tests, and "DEV=false" for prod
  • How to make sure that Dev is unable to access Prod database? Does RLS help here?

Add diagrams to README files

https://mermaid.js.org/intro/

Tasks:

  • discord_bot commands
    • mmr command
    • reminder command
    • leaderboard command
    • twss command
    • emotes command
    • fetch aoe4 command
  • burny_common library
    • available functions
  • fastapi_server available routes and their purposes
    • todolist
    • chat
    • text to speech (twitch)
    • audiobook (behind logged in users)
    • TODO add transcribe site
  • transcribe website
    • Upload video/audio to be queued to be transcribed, queue job (which language, which model to use to transcrible)
    • Download new video with hard-subs
    • Download .srt or other format file to have a separate subtitle file
    • Transcribe worker, how it works and interacts with db

Deprecate fastapi_server project

Because I use supabase as a globally hosted database, and discord bot to access the database, I may as well use it to frequently run checks on the database data?

Alternatively: Find a cheap domain host to host the backend again. This requires me to update the certs every year though

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.