Tensai75 / AddNZBs.py

Add downloaded NZB files to NZBGet - An Extension Script for NZBGet
MIT License
3 stars 0 forks source link

Adding an extension to the NZBGet Extension manager #2

Open dnzbk opened 1 month ago

dnzbk commented 1 month ago

I tested your extension and did a code review and I really like it and I would like to integrate it into NZBGet Extension Manager, but to ensure the quality of the extension we would like to add additional pipelines for tests, releases and static code analyzers. We already have pipelines for tests and releases, but we would like to tweak them a bit and write documentation. You will have to do practically nothing from your side. When the pipelines are ready, you just copy them to your repository and they will automatically start working.

And it would be nice if you had some unit tests ready but I think it's not mandatory and it's up to you. There is a simple example of unit tests written for ExtendedUnrar extension you could use.

Thank you for your contribution!

Tensai75 commented 1 month ago

Thank you for considering my extension for the NZBGet Extension Manager.

As for the unit tests, since I'm just a hobby programmer, I've never actually bothered to learn how to write unit tests. And to really test the script, I think a test installation of NZBGet would have to be running to check if the NZB file was actually pushed to the queue correctly (by checking if the file is included in the queue). I'm not sure if this is feasible, and writing "pseudo" unit tests that can't really test the main functionality of the script probably makes no sense at all.

But as I said, I have no experience in writing unit tests. In any case, I wouldn't mind if someone jumpes in and writes some tests.

dnzbk commented 1 month ago

Sure, no problems. Like I said, it's not that important and won't affect the decision to add your extension to the extension manager. As soon as we finalize the pipelines, I'll let you know.

Tensai75 commented 1 month ago

Hello again,

I have updated the extension again and made some options configurable for the users. Maybe you want/need another code review?

And I have now also made a second extension compatible with the Extension Manager: https://github.com/Tensai75/PPDir.py Maybe this can also be added to the Extension Manager?

I look forward to hearing from you.

dnzbk commented 1 month ago

Hello,

Sure, I'll test and review them.

Thank you!

dnzbk commented 1 month ago

Tested and reviewed - in general looks good to me, but there are a couple of things that can be improved in PPDir: 1) The script doesn't work correctly with the DirectUnpack (SETTINGS->Unpack->DirectUnpack) option enabled. I got two copies of the downloaded files in ${MainDir}/completed/unpacked_file and in ${MainDir}/completed/_unpacked/unpacked_file. 2) Would be nice to change ${mainDir} to ${MainDir}. ${mainDir} works too, but the application uses ${MainDir} everywhere, which can be a bit confusing for the user.

Tensai75 commented 1 month ago

The points you mentioned have been fixed. See:

Thanks for pointing this out!