Giter Site home page Giter Site logo

Stop using singletons about anitopy HOT 2 CLOSED

igorcmoura avatar igorcmoura commented on July 26, 2024
Stop using singletons

from anitopy.

Comments (2)

MeGaNeKoS avatar MeGaNeKoS commented on July 26, 2024 1

The singletons can cause a race condition bug in multi thread where 2 difference thread trying to parse at the same time. From my experience, I got a list of anime_title from 2 difference anime. For now, this bug can be fix using threading.RLock() before parse it.

Here my traceback.

  File "/root/Anime-downloader/src/torrent/upload.py", line 24, in upload
    anime = recognition.track(file_name)
    file_name = '[Judas] Code Geass Movie 04 - Lelouch of the Re;surrection.mkv'
    file_path = '[Judas] Code Geass - Hangyaku no Lelouch (Lelouch of the Rebellion) (Seasons 1-2 + Movies + OVAs) [BD 1080p][HEVC x265 10bit][Dual-Audio][Eng-Subs]/[Judas] Code Geass Movies/[Judas] Code Geass Movie 04 - Lelouch of the Re;surrection.mkv'
    folder_path = '[Judas] Code Geass - Hangyaku no Lelouch (Lelouch of the Rebellion) (Seasons 1-2 + Movies + OVAs) [BD 1080p][HEVC x265 10bit][Dual-Audio][Eng-Subs]/[Judas] Code Geass Movies'
    local_save_path = '//Downloads'
    num_retries = 10
    save_path = '//Downloads'
    torrent_path = ['[Judas] Code Geass - Hangyaku no Lelouch (Lelouch of the Rebellion) (Seasons 1-2 + Movies + OVAs) [BD 1080p][HEVC x265 10bit][Dual-Audio][Eng-Subs]', '[Judas] Code Geass Movies']
    track = True
  File "/root/Anime-downloader/deps/recognition/recognition/recognition.py", line 348, in track
    anime = parsing(anime_filename, is_folder)
    anime_filename = '[Judas] Code Geass Movie 04 - Lelouch of the Re;surrection.mkv'
    anime_filepath = '[Judas] Code Geass Movie 04 - Lelouch of the Re;surrection.mkv'
    folder_path = ''
    is_folder = False
  File "/root/Anime-downloader/deps/recognition/recognition/recognition.py", line 471, in parsing
    anime_name = re.sub(r"[(\[{].*?[)\]}]|[-:]", ' ', anime['anime_title'])
    anime = {
	'file_name': '[ASW] Bucchigire! - 04 [1080p HEVC][F321EB41].mkv',
	'file_extension': 'mkv',
	'video_resolution': '1080p',
	'video_term': 'HEVC',
	'file_checksum': 'F321EB41',
	'episode_number': '04',
	'anime_title': ['Bucchigire!', 'Code Geass Movie 04 - Lelouch of the Re;surrection'],
	'release_group': 'ASW',
	'anime_type': 'Movie'
	}
    filename = '[Judas] Code Geass Movie 04 - Lelouch of the Re;surrection.mkv'
    is_folder = False

from anitopy.

igorcmoura avatar igorcmoura commented on July 26, 2024

That's a good point. This is worse than I previously thought.

I will try to fix this as soon as possible.

from anitopy.

Related Issues (9)

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.