Closed soapdog closed 3 years ago
Comment https://github.com/Himalayan-Academy/Siva-Siva-App/issues/274#issuecomment-813624634 is related to this issue as well.
Saving more than one entry on the journal works on the desktop but all entries added after loading from the journal end up broken with missing data.
For example, these two entries below. The first one is after selecting the audio from My Downloads, the second is after going to the journal and loading the first entry.
[
{
"item_id": "9134",
"timeStamp": 2.40079e+06,
"title": "The Concept of Awareness, Part 2",
"hoursMinutes": "00:00:54",
"selectNum": 1,
"card": "listen-file",
"url": "/Users/agarzia/Documents/SivaSivaApp/media/audio/inspired-talks/bodhinatha/2021/bd_2021-01-14_concept-of-awareness_part-2/bd_2021-01-14_concept-of-awareness_part-2.mp3"
},
{
"item_id": "9134",
"timeStamp": 3.12886e+06,
"title": "The Concept of Awareness, Part 2",
"hoursMinutes": "00:01:10",
"selectNum": null,
"card": "listen-file",
"url": null
}
]
The main problems are the missing url
and selectNum
entries.
Be aware that the extreme coupling in this code between what is playing and selectedNum
is a source of major problems and will lead to bugs.
A ton of code in behavior_Listen
and behavior_ListenSelectPlay
use the selected line as an array index. This is extremely bad practice! Specially because that data needs to be saved to the journal to effectively load the audio back when journalResume
happens.
If the user downloads a file, and later deletes that file, they will change the position of all the tracks after the deleted track on their audio download list, they'll shift by the number of deleted tracks. So values saved will no longer point to the correct location.
This will cause trouble and refactoring this requires changing the structure of those behaviors to work in a way that doesn't depend on the order of the list of tracks being displayed.
This is a major refactoring and should be done before releasing this to the public.
This latest commit made the Journal and Listen module work well on Android. Saving and resuming audio work as expected.
Confirmed: the multiple Journal entries of the downloaded audio do exist
We get only get a journal entry, but only the first entry.
But not of the second entry, because (in my estimation) it playing from Journal. But it must have TWO entries (because the user may keeps, lets say three entry, one goes to a part that he really likes, the other one was the top entry, where he was only the last session.
There is no entry, only to the first one. When we get back, via Journal enter, and go forword, listen to again, if we are forward, clicking again on the record of Journal. And then we go to the Journal there needs to TWO entry. Once yesterday, and the second one is advanced forward.
Originally posted by @Brahmanathaswami in https://github.com/Himalayan-Academy/Siva-Siva-App/issues/274#issuecomment-813610488