Commit Graph

48 Commits

Author SHA1 Message Date
Théo B
546d459696 Performance Improvements
Pass theme list & its entries around by reference rather than copying them.
Fix bug in async icon loading that caused icons to be loaded multiple times.

Original PR by @LiquidFenrir
2024-05-10 17:43:47 -04:00
7e2191ad86 Add x-zip-compressed to acceptable mime types
Closes #287
2024-04-24 14:42:10 -04:00
Dylan G
18cb5c616f Correctly handle cases where files already exist on the filesystem.
Also: patched a bug wherein the filename filter was acting up, transforming `file.zip` to `file-zip.zip`, for example.
2021-06-17 01:43:50 +01:00
Dylan G
7745530764 Fixed 4720a499 (TP returns 303 currently, not 404) => handle 303 well(?); pushed some code around 2021-03-11 13:47:24 +00:00
Dylan G
aba2cd5f18 Finally update copyright; Flask meta files removed 2020-12-24 23:38:58 +00:00
Dylan G
1e5d09e85a Major refactor to networking, including a fix for an incorrect error message on cancelling the swkbd for downloads 2020-12-24 23:34:17 +00:00
Alex Taber
573b7d35e6 Fix potential hang in QR reader 2020-12-23 16:51:57 -05:00
a2b6eb94e4 Fix regressions introduced in 1c2e562dd6 2020-12-23 16:20:49 -05:00
Théo B
95ff2dd3ba Memory leak fix and camera multithreading safety improvement (#239)
* memory leak fix and attempt at optimizing space

* camera rework

try to use better locking algorithm (MRSW lock on wikipedia)

* add time print (toggleable) and stuff

remove old mixed qr thingss from main

* remove the dumb 3 bytes saving

* remove useless time measure code

* forgot to close the stop event handle

* fix memory leak when loading icon from smdh

* fix entry path on folders

optimization using memcpy cause it to have the "/info.smdh" when the entry is a folder. simply remove that with a memset to 0.

Co-authored-by: Alex Taber <astronautlevel2@users.noreply.github.com>
2020-12-21 22:31:38 -05:00
Dylan G
1c2e562dd6 Networking rework (#240)
* Began refactoring http_get. Still a few cases to handle, but it works.

* Introduced error enum; handle error 406; handle a misbehaving server; redirect_url leaked memory (L888)

* Allowed calls to http_get to pass NULL as acceptable_mime_types

* Removed status_code from header struct; eventually planning to move most of parse_header's logic back to http_get, so this makes sense

* Moved some more logic back into http_get
Note: currently behaves weirdly with some QR codes, including but probably not limited to ones pointing to TinyURL.

* Handle redirects correctly; other rearrangements

* Formatting

* Handle HTTP 303 See Other correctly

* Removed "Download failed" error in camera.c due to all related failures being handled in http_get

* Fixed missing loading bar; started working on unchunked download

* Added unchunked download

* Reintroduced the download progress bar, rolled back to always doing chunked download

* URL length caps at 2083 chars

* Slightly more efficient

* Correctly handle incorrect filesize header
TODO: reorder clauses to remove the goto?

* Fixed illegal characters, removed unnecessary logic (technically a regression, as we always have to realloc now)

* Finally finished up status code handling. Fixed a memory leak when the server fails conneg.
2020-12-21 21:11:11 -05:00
6a51b4eae5 Fix misc. QR code bugs
Close data->started properly, don't double close data->cancel
Should fix the QR code hang
2020-06-22 12:27:14 -04:00
2c2c7f4b33 Fix double free 2020-06-11 21:24:01 -04:00
e8d0a2eb27 Fix similar (but unrelated to the previous) race condition 2020-06-11 14:34:14 -04:00
f4217888ce Fix bug caused by race between theme thread & QR reader UI thread 2020-06-11 13:48:34 -04:00
9e378b5059 Fix camera initialization on CTR cameras 2018-08-20 18:38:04 -04:00
d3e1b746cd Various improvements to QR scanner
* Improve QR scanner initialization time
* Fix race condition with QR scanner and button spamming
* Don't show black screen before QR scanner has loaded
* Show loading message for QR scanner
2018-07-26 22:02:54 +03:00
Alex Taber
c40696e982 Citro2d switch (#175)
* Switch from pp2d to citro2d

* Fix various bugs by updating libarchive

* Begin work on translation infrastructure

* Switch to libpng for various improvements

* Fixed race condition in icon scrolling

* Use spritesheets to load sprites marginally faster and use less memory

* Various Readme fixes

* Huge improvements to QR reader speed and screen tearing

* Don't try to preview themes/splashes when there are none

* Prevent playing audio when ndspInit() fails

* Don't wait for audio to load before displaying preview

* Fix bug when shuffle themes didn't have BGM

* Fix bug caused by files not being zeroed out when created
2018-07-22 21:22:23 +03:00
1c3e8809f6 Fix UB caused by using a free'd struct (actually fix QR code reader) 2018-05-11 18:01:35 -04:00
LiquidFenrir
3dad4e2a67 fix DEBUG calls 2018-05-11 15:59:17 +02:00
LiquidFenrir
403453c3fc add a loading bar (#159)
- when loading icons
- when downloading via QR
- when loading list in the browser
- when loading preview/BGM in the browser
- when downloading from the browser
2018-05-11 09:53:38 -04:00
fe58e2d938 Fixed QR code bug 2018-05-11 09:45:21 -04:00
d2b83659ea Fix race condition with music not being done playing 2018-05-11 07:42:05 -04:00
8189264908 Fix race condition in QR reader - slightly broken (doesn't run more than once) 2018-05-10 22:08:24 -04:00
95d8808a73 Copyright Update
* Replaced contributors section in README with CONTRIBUTORS.md
* Updated copyright notice to include all contributors
* Updated SMDH
2018-04-10 16:09:10 -04:00
LiquidFenrir
6c2f09147f Themeplaza caching (#147)
* change fs to use a FS_Path argument for remake_file and buf_to_file

* more debug information when downloading

* browser caching v1: poc, works and is fast but not ideal

* add preview to cache

* this wasnt meant to be added now
2018-04-10 15:12:37 -04:00
LiquidFenrir
cd69aa7ef7 Switch to libarchive and camera autodetect between splashes and themes (#142)
* switch to libarchive and get rid of minizip, introduce zip_memory_to_buf

* automatically detect whether the downloaded zip is a splash or a theme

* slightly simpler way
2018-04-01 22:21:31 +02:00
LiquidFenrir
a2b5788fe8 Themeplaza browser (#140)
* builds at least

* meh, multithreading will come later. or never

* movement added, and correct grid mode

* switching splash/themes when in browser mode

* closer to the actual themeplaza menu

* bring back downloading from qr

* show a download screen when downloading from browser

* fix selecting with touchscreen in browser mode

* update readme for jansson

* fix quitting with start in browser mode

* add jump menu for browser mode

* rotate is broken, add working touchscreen page changing

* allow quitting preview mode with B in browser mode

* proper way to have portlibs

* add searching

* show error when search has no results

* always free entries and icon ids
2018-03-31 20:31:46 -04:00
LiquidFenrir
c6f3af7350 Reload lists after scanning, and move text to bottom to leave top solely to camera (#126)
* reload lists after qr code is scanned

* move "press R to exit" to bottom screen
2017-12-31 16:01:26 +01:00
10b130b416 Multithread QR scanning 2017-12-31 01:20:38 -05:00
LiquidFenrir
d937ae1716 Major rewrite: less repetition (#101)
* first step of rewriting: at least it compiles™

* fix tabs/spaces

* fix dabort on load

* fix preview crash

* sorting isnt done outside of loading

* step one of making remake_file useless

* camera/qr code cleanup

* fix dabort when folder is empty, and bring back preview optimization

* fix button for switching modes and show mode when folder is empty

* fix scanning qrs

* no more splash discrimination

* add debug helpers

* fix theme installing
turns out that wasnt such a good idea

* fix battery icon

* mistake

* themeplaza compatibility

* make use of load_data

* don't drink and copy-paste, kids

* fix user-agent

* remove useless

* cleanup includes

* not even used

* add splash buttons

* upgrade buttons drawing

* fix controls while preview is up

* improve positions
2017-12-02 10:09:38 -05:00
Dylan G
36106b72f2 In-line with master updates (pushed to wrong branch) 2017-10-22 00:45:09 +01:00
Helloman892
204d5e8a85 added throw_error() for non-theme/splash QR targets 2017-10-16 19:46:20 +01:00
Luís Marques
6c3fdbaf31 Seems to stop it from crashing on non-theme QR scan. (#96)
This seems to stop Non-theme QR crash.
2017-10-16 09:46:53 -04:00
8ba1fed5d7 Change QR reader behavior, speed up 2017-09-09 11:33:54 -04:00
ef456c7e9e Splash previews 2017-09-09 00:12:16 -04:00
1103885baf Splash QR codes 2017-09-08 23:34:16 -04:00
97ab2307f8 Slightly improve QR code speed 2017-09-08 23:26:49 -04:00
2be3bde64d Merge branch 'master' of github.com:3dsfug/Anemone3DS 2017-09-08 07:21:34 -04:00
c46c5ff8cb More CAMU stuff 2017-09-08 07:21:31 -04:00
Helloman892
6b5b391d7b finally got theme deletion working + qr stuff
Theme deletion [SDMC] now works, although no button currently has it assigned. The QR reader now works properly with Unicode filenames.
2017-09-07 22:36:44 +01:00
0871f4f30b Break QR code reader trying to make it faster 2017-09-07 13:08:38 -04:00
ZetaDesigns
674fa9d9bf add "downloading" text to qrcode scanning
i know it's not the prettiest idea to put it in draw_theme_install, but it seemed like the most fitting, and i didnt want to create another function for it
2017-09-06 17:49:10 +02:00
Uyuiyu
33cce81914 signed 2017-09-06 02:16:03 +02:00
02526707a0 Fix invalid characters in QR codes 2017-09-04 14:40:20 -04:00
03497a79ef Fix green tint on CTR cameras 2017-09-04 13:40:33 -04:00
5fc499ff78 Automatically update themes list when a new theme is downloaded 2017-09-04 02:42:27 -04:00
3241544296 (Mostly) finish QR support 2017-09-04 02:03:58 -04:00
Alex Taber
b7d15da092 Qr stuff (#32)
QRs are now scanned and decoded, but they aren't downloaded.
2017-09-03 12:52:02 -04:00