/images/gsoc.png

After few regressions and hours of fixing issues I got the headerbar and sidebar revamp MR merged so we start the week on a high and more than that we had the first official build of Kasts, yay!
Sprucing up my content discovery this week and now with a plan to tackle it, I was able to use a XmlListModel and parse the OPML file and was able to put together a MR for the same. I was supposed to add a C++ one instead, but the XmlListModel seemed like a perfect solution since it was supposed to be a read-only model and it was relatively easier to use (eh, lazy).
Now lets discuss a bit what a model is and how the XmlListModel works in Kasts.
So a model is basically a adaptor class which is used to access structured data. Custom models can be subclasses of QAbstractItemModel, and we need to expose data at hand using a unified API. There are several QML types for eg the List Model, XML Modeln Integer Models, Object Models etc. and also you can create your own C++ data models that are used with Views such as ListView, GridView, PathView, Repeater, TableView, etc. to visualize the contents of these models and using a delegate to draw a single entry of data and interact with it.
So the OPML file we were importing will contain our actual data. We will need a model to sort of wrap around the data and make it available for us in the form of roles and then ultimately display as a list for the users to check the search results. Remember that the data is not stored inside the model per se, the data is just provided to the model and its the models job to adapt to that data so that it can be used with a view.
After that exposing the data to the XmlListModel is pretty easy, and I could follow along from the Qt docs.
So all I was left to do was attach the search url which is quite simply-
*https://gpodder.net/search.opml?q=**your-search-here***
to a TextField and a Search button, voila, you can now search for podcasts from the internet and display the results. For more convenience I also added a drawer that would display the metadata for the podcast and also a button that would simply Subscribe the required podcast.
Next week I would be looking to craft a massive discover page, even though this was not part of my GSoC timeline, I decided to start working on this because I just love QML :), I hope it to be a full blown podcast searching platform.

License

MIT License

Copyright (c) 2023 swaptr

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.