Remove unused fields from json and database representation #40

Merged
MicMun merged 1 commits from leafar/nextcloud-cookbook:optimization into master 5 months ago
leafar commented 5 months ago

These fields aren't used and don't seem particularly useful to keep around.

These fields aren't used and don't seem particularly useful to keep around.
leafar added 1 commit 5 months ago
Owner

You are faster than me, I have at thursday time to look.
You can take a little more time :)

You are faster than me, I have at thursday time to look. You can take a little more time :)
Poster

No need for hurry. Take your time :)

No need for hurry. Take your time :)
Owner

Are you sure, that the fields aren't needed by the server nextcloud cookbook?
I let them in, because with the editing feature the app must write all data from original file in the replacement json file.
So I don't know, if we should remove fields at saving the recipe.

The editing feature is on the todo list (one of the issues), so I think with this pull request we get problems in the future.

Are you sure, that the fields aren't needed by the server nextcloud cookbook? I let them in, because with the editing feature the app must write all data from original file in the replacement json file. So I don't know, if we should remove fields at saving the recipe. The editing feature is on the todo list (one of the issues), so I think with this pull request we get problems in the future.
Poster

Good point, I just fetched a test recipe with the latest NC cookbook (0.8.4) to confirm this.

These members I removed from Recipe were not present in the json saved by the NC App. To my understanding they try to conform to https://schema.org/Recipe where these fields aren't present either. Hence I would consider it safe to remove them.

  • idUrl/"@id"
  • jsonId/"id"
  • imageUrl (possibly was used before you added thumb/fullImageUrl?)
  • printImage

(Note however that "@id" is part of the json-ld standard. It can store a unique resource identifier.)
I also removed the member 'id' as it isn't serialized anyway. (It's the database id)

Then I removed the matching fields on the DbRecipe, too. I also removed context and type, as all recipes should conform to the same schema (see above) and thus they would all be the same.

Good point, I just fetched a test recipe with the latest NC cookbook (0.8.4) to confirm this. These members I removed from Recipe were not present in the json saved by the NC App. To my understanding they try to conform to https://schema.org/Recipe where these fields aren't present either. Hence I would consider it safe to remove them. * idUrl/"@id" * jsonId/"id" * imageUrl (possibly was used before you added thumb/fullImageUrl?) * printImage (Note however that "@id" is part of the json-ld standard. It can store a unique resource identifier.) I also removed the member 'id' as it isn't serialized anyway. (It's the database id) Then I removed the matching fields on the DbRecipe, too. I also removed context and type, as all recipes should conform to the same schema (see above) and thus they would all be the same.
Owner

Okay, that sounds good.
I wanted to ask, before we get into problems. But with your analysis it is okay.

Okay, that sounds good. I wanted to ask, before we get into problems. But with your analysis it is okay.
MicMun merged commit 7117813c4e into master 5 months ago
The pull request has been merged as 7117813c4e.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.