UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Podbird reignited

    Scheduled Pinned Locked Moved App Development
    100 Posts 22 Posters 30.8k Views 9 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • T Offline
        theare27 @Giiba
        last edited by

        @Giiba I've been poking around the code a bit this afternoon. I'm a web developer not an OS / native apps guy so I could be way off, but it certainly looked to me as if clearQueue (which deletes everything from the Queue table) is being called when the app exits

        If that's the case, I wonder if that could be tweaked so that it could be controlled from the conf file

        a clearQueueOnExit boolean flag

        But like I said, I could be misunderstanding the code

        G 1 Reply Last reply Reply Quote 2
        • G Offline
          Giiba @theare27
          last edited by

          @theare27 better than I!

          I once poked around the code and all of it meant nothing to me.

          1 Reply Last reply Reply Quote 2
          • T Offline
            theare27
            last edited by

            Podcasts.clearQueue() is called as part of Component.onDestruction which I'm assuming is on app closure

            jezekJ CiberSheepC 2 Replies Last reply Reply Quote 1
            • jezekJ Offline
              jezek @theare27
              last edited by

              @theare27 try to comment it out, what happens (or not happens) πŸ˜„

              jEzEk

              arubislanderA 1 Reply Last reply Reply Quote 0
              • CiberSheepC Offline
                CiberSheep @theare27
                last edited by CiberSheep

                @theare27 said in Podbird reignited:

                Podcasts.clearQueue() is called as part of Component.onDestruction which I'm assuming is on app closure

                Pretty sure that is to clear the queue of episodes that you can pile.

                The position of the episode is stored in the db

                Position (even if it looks to jump) is stored and retrieved, so I suspect that might be a change in the Media-hub. We started experimenting position lost when moved to Xenial
                https://paste.ubuntu.com/p/4VqqDpG64c/

                Another planet, another time, another universe!

                1 Reply Last reply Reply Quote 0
                • arubislanderA Offline
                  arubislander @jezek
                  last edited by

                  @jezek
                  Commenting it out keeps the entries in the Queue database, but extra code is needed in the Component.onCompleted to populate the playlist with the entries:

                          db.transaction(function(tx) {
                              // Rebuild queue in order
                              var rs = tx.executeSql("SELECT url FROM Queue ORDER BY ind ASC")
                  
                              for (var i=0; i<rs.rows.length; i++) {
                                  player.playlist.addItem(rs.rows.item(i).url)
                              }
                          })
                  

                  πŸ‡¦πŸ‡Ό πŸ‡³πŸ‡± πŸ‡ΊπŸ‡Έ πŸ‡ͺπŸ‡Έ
                  Happily running Ubuntu Touch
                  Google Pixel 3a (20.04 DEV)
                  JingPad (24.04 preview)
                  Meizu Pro 5 (16.04 DEV)

                  T 1 Reply Last reply Reply Quote 2
                  • T Offline
                    TartanSpartan @TartanSpartan
                    last edited by

                    @TartanSpartan said in Podbird reignited:

                    I believe the progression from the Vivid to the Xenial build introduced a regression wherein you used to be able to have your place in an episode automatically saved when the app closed, but now no longer. Shall test this theory on my new M10 (with Vivid) later.

                    Definitively confirmed.

                    T 1 Reply Last reply Reply Quote 1
                    • T Offline
                      theare27 @TartanSpartan
                      last edited by

                      @TartanSpartan
                      Not saying it's not a problem external to the application - could well be

                      But when the app exits the Queue table in the app's SQLite database is cleared - everything is deleted from that table

                      Data in other tables - like the Podcast one that holds the subscriptions persist so it would certainly seem like clearing out the queue on app exit is a deliberate action that's triggered somewhere

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        theare27 @arubislander
                        last edited by

                        @arubislander And there's also no way to get back to the "now playing" screen after the app is restated without starting to play a file - which in itself would wipe the previous queue

                        Would it be possible to add a "Now Playing" entry to the hamburger menu so that one can get back to where they were

                        Like you say, stopping the queue from being wiped out is only half the problem

                        1 Reply Last reply Reply Quote 0
                        • G Offline
                          geekvine
                          last edited by

                          I have uploaded my fork to gitlab as a private repo. If the original devs end up being cool with it, I'll mark it public and post a link.

                          T 1 Reply Last reply Reply Quote 2
                          • T Offline
                            theare27 @geekvine
                            last edited by

                            @geekvine yes please, happy to test
                            I must admit this podcast business has me on the verge of going back to Android

                            Playback stopped randomly for me this morning in the middle of a podcast. Wouldn't play anything. So then I have to reboot & I've lost my queue and my position.. again

                            It probably wasn't podbird's fault that the sound system stopped & I really don't mind the occasional need to reboot, but loosing where I am continually is exasperating

                            arubislanderA 1 Reply Last reply Reply Quote 0
                            • arubislanderA Offline
                              arubislander @theare27
                              last edited by

                              @theare27 There are two separate issues here:

                              1. The queue gets cleared when the app is closed
                              2. The position in the currently playing podcast is not preserved when the app is exited.

                              #1 is easily solved.
                              #2 needs more investigation.

                              πŸ‡¦πŸ‡Ό πŸ‡³πŸ‡± πŸ‡ΊπŸ‡Έ πŸ‡ͺπŸ‡Έ
                              Happily running Ubuntu Touch
                              Google Pixel 3a (20.04 DEV)
                              JingPad (24.04 preview)
                              Meizu Pro 5 (16.04 DEV)

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                danqo6
                                last edited by

                                Hello guys, I recently implemented importing podcast with OPML file (I was migrating from android so needed that feature πŸ˜„ ). It was only one day effort, but I am willing to help more. Here are some issues for the next milestone. Main issue for me is still this, it can be really anoying.

                                T 1 Reply Last reply Reply Quote 2
                                • T Offline
                                  theare27
                                  last edited by

                                  I have a workaround!

                                  I'm so thrilled

                                  It's hacky as hell but it works
                                  In the Music App I've created a "Podcasts" playlist

                                  I have a bash script that:

                                  Rsync's the downloaded podcasts that sit in
                                  /home/phablet/.local/share/com.mikeasoft.podbird/podcasts/
                                  to a "Podcasts" folder in
                                  /home/phablet/Music/

                                  This is set to delete in the destination any file that's removed from the origin

                                  An sql script executed that reads the Podbird sqlite database to get the list of current downloaded files and their titles and pull it into a current_files table in a staging sqlite db

                                  current_files only contains what's currently been downloaded by Podbird
                                  Alongside that I have an all_files table

                                  If a filename in current_files isn't in all_files, it is copied into all_files

                                  all_files will eventually contain filename of all the files that have ever been seen. It also has a previously_inserted flag that defaults to 0 when a record is created

                                  The script then inserts into the Music app db's track table adding every thing in current_files, but cross referencing with all_files so that it only inserts what hasn't been previously_inserted

                                  Once written to Music app's track table the previously_inserted flag in all_files is updated to 1

                                  It also deletes from the track table any entries that aren't in the staging db's current_files, so that entries aren't orphaned when Podbird auto deletes an old file

                                  So all in all

                                  • Use Podbird to manage downloads / auto-downloads/ auto-removal of Podcasts files
                                  • Podcast files are synced to ~/Music/Podcasts/
                                  • The "Podcasts" playlist in the Music App is updated with current podcasts where they haven't been added before
                                  • I can re-arrange the playlist in the Music App whichever way I want it
                                  • I can remove things from the Music App playlist that I've listened to or I don't want to listen to
                                  • The script runs every 5 minutes on a cron so anything new Podbird downloads will auto populate into the playlist in the Music App within 5 minutes

                                  I might still have to find where I was if I quit the Music app or have to reboot, and I'll have to manage the playlist in the Music App, but that's all doable

                                  Hacky as hell like I said, but I think I can make it work for me like this

                                  I'd need to polish it up a bit if I was going to share what I've come up with but I'd be happy to do that if it's of any use to anyone else

                                  jezekJ G 2 Replies Last reply Reply Quote 0
                                  • jezekJ Offline
                                    jezek @theare27
                                    last edited by

                                    @theare27 +1 πŸ˜„ hell of a hack...

                                    the next stage should be to take all the sql queries and logic (file copying, conditions, ...) and make it work inside Podbird (qml should be able to handle all these), so there is no need to use cron & shell scripts. πŸ˜‰ Qml is easy, if you are on the level of writing shell scripts & sql queries.

                                    jEzEk

                                    T 1 Reply Last reply Reply Quote 1
                                    • T Offline
                                      theare27 @jezek
                                      last edited by

                                      @jezek Can these app interact with stuff outside their own directories though?
                                      Initially I didn't have the Rsync part, I just created a soft link between com.mikeasoft.podbird/podcasts/ and the Music folder, but the Music app couldn't read those files at all, it just dropped the entries from the track table

                                      Whether it was because it couldn't follow a soft link or because the soft link went to another app's scope I'm not sure

                                      I'm not sure what sort of containment UT touch apps have & how they can interact with each other on that kind of level

                                      I'm sure there's big scope to improve on it

                                      1 Reply Last reply Reply Quote 0
                                      • jezekJ Offline
                                        jezek
                                        last edited by

                                        @theare27 Ah, now I understand. I read everything again few times and now I see my mistake. You are talking about 2 apps. Podbird and Music app. I thought you were doing the hack only for Podbird. My fault, sorry.

                                        Can these app interact with stuff outside their own directories though?

                                        I think, you can specify some special directories (Downloads, Music) in clickable apparmor config. For example see, how Music App defines permissions.
                                        Interactions between apps should be handled via Content Hub.

                                        Initially I didn't have the Rsync part, I just created a soft link between com.mikeasoft.podbird/podcasts/ and the Music folder, but the Music app couldn't read those files at all, it just dropped the entries from the track table

                                        If symlink for directory fails, mount --bind can sometime save the days. πŸ˜„ But in this case expanding Podbird's access privileges should do the trick, I think.

                                        jEzEk

                                        T 1 Reply Last reply Reply Quote 0
                                        • T Offline
                                          theare27 @jezek
                                          last edited by

                                          @jezek Yeah, sorry if I wasn't clear - yes I'm talking about two apps

                                          Levereging Podbird for what it does well: managing podcast subscriptions, file downloads & removal,but then handing the task of playback over to the Music app because that does a good job of playlist management & playback

                                          And what I've come up with is a little integration script that just manages the hand off between the two, so that the stuff that Podbird downloads gets automatically pushed into a playlist in the Music app

                                          Early days still, but so far it seems to be working alright. New episode downloaded by Podbird this morning & it pops into the Podcast playlist within a couple of minutes

                                          Of course it'd be nice if Podbird could do it all, but with this setup I can manage & I'm a step closer in terms of making UT work for me as my primary daily driver

                                          1 Reply Last reply Reply Quote 0
                                          • T Offline
                                            theare27 @danqo6
                                            last edited by

                                            @danqo6 is there a tutorial on setting up then environment for combiling Podbrid, building .click packages etc that you're aware of?

                                            Wouldn't mind having a go at experimenting with hacking on the code & building my own development version

                                            jezekJ 1 Reply Last reply Reply Quote 0
                                            • jezekJ Offline
                                              jezek @theare27
                                              last edited by

                                              @theare27 said in Podbird reignited:

                                              @danqo6 is there a tutorial on setting up then environment for combiling Podbrid, building .click packages etc that you're aware of?

                                              Using clickable for UT app development was the right way for me. There are many topics about app development in this forum.

                                              jEzEk

                                              1 Reply Last reply Reply Quote 0
                                              • First post
                                                Last post