Skip to content

Make item add and edit safer to use on client-side#195

Open
pvj wants to merge 3 commits into
masterfrom
dev/reorganise-add-item-tpl
Open

Make item add and edit safer to use on client-side#195
pvj wants to merge 3 commits into
masterfrom
dev/reorganise-add-item-tpl

Conversation

@pvj

@pvj pvj commented Apr 15, 2025

Copy link
Copy Markdown
Member
  • add template, edit template updates include: better representation of episode states and action on the form
  • add, edit api: ability to data update w/o files, ability to broadcast update w/o files, extended error handling

Updated HTML templates of add and edit item.
Refactored parts of add and edit api but it should still work with the current schema and data. This is what we have to test.

Important changes and details include;

  • Now you can upload au or img files by themselves
  • Now you can reset image upload or audio upload on add and edit
  • Adding new episode must include a picture too
  • If no picture added we try to fall back to the show url or the lahmacun logo
  • layout and style updates
  • When writing files to disk: Archive to lahmastore is selectable on edit, on by default on add
  • Arcsi cleans up tmp files after successful broadcast edit

Please take a look I will be testing this a lot too.

@pvj pvj added enhancement New feature or request front-end back-end labels Apr 15, 2025
@pvj pvj requested a review from tuz666 April 15, 2025 23:01
@pvj pvj force-pushed the dev/reorganise-add-item-tpl branch from ac96a6f to 371dd62 Compare April 15, 2025 23:09
@pvj pvj changed the title Make item add and edit safer to use on client-side [Draft] Make item add and edit safer to use on client-side Apr 15, 2025
@pvj pvj force-pushed the dev/reorganise-add-item-tpl branch from 371dd62 to 1070ddc Compare April 16, 2025 00:15
@pvj pvj force-pushed the dev/reorganise-add-item-tpl branch from 2a65ec9 to 7dcae05 Compare April 18, 2025 01:08
@pvj pvj force-pushed the dev/reorganise-add-item-tpl branch from 7dcae05 to c8bc386 Compare April 18, 2025 01:19
@pvj pvj force-pushed the dev/reorganise-add-item-tpl branch from c8bc386 to af168da Compare April 18, 2025 01:33
@pvj pvj force-pushed the dev/reorganise-add-item-tpl branch from af168da to b256406 Compare April 18, 2025 18:53
@pvj pvj force-pushed the dev/reorganise-add-item-tpl branch from 50f865d to 783ed98 Compare April 18, 2025 20:43
@pvj pvj changed the title [Draft] Make item add and edit safer to use on client-side Make item add and edit safer to use on client-side Apr 18, 2025
@pvj

pvj commented Apr 18, 2025

Copy link
Copy Markdown
Member Author

@tuz666 I fixed the code that threw test errors. Thanks for your work, it is reasssuring to have this test suite running and we can easily debug exceptions introduced to any api endpoint.

The PR now should be ready for review. .

Comment thread arcsi/api/item.py
db.session.add(item)
db.session.flush()
empty_files = all([not (_v) for _v in request.files.values()])
request_files = {k: v for k, v in request.files.items()}

@tuz666 tuz666 Jul 27, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my PR I totally missed this part where you separated the handling of the form depending on the existence of the attached image and audio files.
This could be a nice potential addition in the future (or maybe we can handle this under your media schema idea)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's too bad this was the main improvement on this branch.

I think what I would do now in this situation is the following:

  • Merge your PR to main
  • Rebase my branch on top of the new main (with your changes)

Then we can possibly easily integrate these changes from my branch. What do you think?

Comment thread arcsi/api/item.py
Comment thread arcsi/api/utils.py
@tuz666

tuz666 commented Sep 23, 2025

Copy link
Copy Markdown
Collaborator

Most of the proposed features were covered in #199

This part was missing and I think it would be nice to implement:

add, edit api: ability to data update w/o files, ability to broadcast update w/o files, extended error handling

@pvj pvj force-pushed the dev/reorganise-add-item-tpl branch from 5cbe673 to 7650c42 Compare January 4, 2026 20:56
@pvj

pvj commented Jan 4, 2026

Copy link
Copy Markdown
Member Author

@tuz666 This branch is now rebased to latest master. There might be errors caused by the rebasing and conflict resolution. On the other hand now we have only the changes for editing with empty files.

@pvj pvj force-pushed the dev/reorganise-add-item-tpl branch from 7650c42 to bc97652 Compare January 4, 2026 21:14
@pvj pvj force-pushed the dev/reorganise-add-item-tpl branch from bc97652 to 06dfb32 Compare March 7, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants