Closed nbl1268 closed 4 years ago
I think this would be useful, but would benefit from a 'smart' approach which ties in nicely with your PR that I recently merged.
Some podcasts have the programme name as the first part of each episode name (not that they should really, but some do anyway), so this would cause the programme name to show twice. A nice approach would be to extend and rename StripDateFromName
in TextUtils to make a 'smart' episode name by stripping the programme name from the start of the episode name (if it is there) and then adding it back in a consistent manner.
In case I've not explained it very well:
Programme Name | Episode Name | 'Smart' Name |
---|---|---|
Programme 1 | Episode 1 | Programme 1: Episode 1 |
Programme 2 | Programme 2: Episode 1 | Programme 2: Episode 1 |
Programme 3 | Programme 3 - Episode 1 - 05-12-2017 | Programme 3: Episode 1 |
Programme 4 | Episode 1: 05/12/2017 | Programme 4: Episode 1 |
Programme 5 | 05/12/2017 | Programme 5 |
For completeness, the current 'Episode Name' column in the Downloads list could be renamed to just 'Name' and a new 'Episode Name' column could be added which just displays the raw episode name without date stripping etc.
I like the approach you've outlined, and table helps :).
Perhaps rather than altering the StripDateFromName
function suggest creating a new function named StripProgrammeNameFromEpisode
or SmartName
instead.
I like the approach you've outlined, and table helps :).
Great :smile:
Perhaps rather than altering the StripDateFromName function suggest creating a new function named StripProgrammeNameFromEpisode or SmartName instead.
Sure, keeps things a bit more separated - can always juggle things around later if it gets awkward.
Have made some small progress on this enhancement; with new column in download list, and half working function to create a 'SmartName' and populate that new column directly in the download list.
However, in getting this far i'm now pondering how best to handle sorting when the user clicks the column header. I see that current sorting is achieved through mostly by the sql query OrderBy command.
So, your thoughts on approach; is an additional data field named 'smartname' in the episode table a better option? allows the smartname to created once and stored (rather than each time the download list is initialised), and allows the sorting function to remain consistent for each column.
Thoughts on this?
I'd say to plough on with the basic smart name implementation without worrying too much about it for the moment, but I think that we could probably cheat and sort by programme name, episode name and episode date to give a fairly close approximation of the correct order...
Have come across a couple of other variations on the programme name in episode name, based on a few podcasts i found.
Programme Name | Episode Name |
---|---|
Programme | {abbreviations} Episode |
Programme | Programme {extra words}: Episode 1 |
The extra words I've identified so far are: 'Live', 'New', 'Extra', 'Bonus' With the abbreviations, so far only come across one which is WS and I believe stands for 'World Service' (is from a BBC podcast 'More or Less').
Re sorting, yes i think this is a good approach too and have implemented that. Minor issue, there are a few instances where the episode name in the database has the program name at front, so this is making the sort outcome not entirely right, but still close. May be worth looking at the where new episodes are added and using this to also remove the programme name at that point. Dont imagine that should be a lot of work...?
Run in to another issue (minor i'm hoping) seem to ended up with a second test adapter which is now preventing the xunit testing from running. Had any experience with that?
Have come across a couple of other variations on the programme name in episode name, based on a few podcasts i found.
Think it will look okay with the rules above:
Programme Name | Episode Name | 'Smart' Name |
---|---|---|
Programme 1 | WS Episode 1 | Programme 1: WS Episode 1 |
Programme 2 | Programme 2 Live: Episode 1 | Programme 2: Live: Episode 1 |
The first case doesn't look brilliant, but I think identifying abbreviations correctly for all podcasts without removing useful information would end in madness...
Re sorting, yes i think this is a good approach too and have implemented that. Minor issue, there are a few instances where the episode name in the database has the program name at front, so this is making the sort outcome not entirely right, but still close. May be worth looking at the where new episodes are added and using this to also remove the programme name at that point. Dont imagine that should be a lot of work...?
Yes, it won't be 100% but I think it is close enough for the moment. Adding columns to the database isn't the end of the world but it is a bit of a faff. It might also be worthwhile implementing as an in-memory table of 'smart names' and sorting by that, but again I think that should be a separate change.
Run in to another issue (minor i'm hoping) seem to ended up with a second test adapter which is now preventing the xunit testing from running. Had any experience with that?
Am afraid that is a new one on me...
Sorry re long absence from this... finally got my xunit testing problem (dual adapters) sorted. Solution required install xunit and xunit.runer.visualstudio packages, then clear Visual Studio cache, and reinstall those packages, however i found that i needed version 2.3.0 of xunit.runner.visualstudio to work with visual studio community 2015 with update 2. Do let me know if moving up to xunit.runner.visualstudio v2.3.0 will cause any problems for you.
Have now finished testing those date formats and the Programme Name, Episode Name and 'Smart' Name presenting correctly.
I'll just do some code/comment clean up over the next few days and then look to do a pull request to see that CI testing is successful.
No worries. I think I came across a similar issue the other week... Don't think it should be a problem to bump the xunit runner version.
Look forward to seeing your PR :+1:
Right have raised PR#222 to cover the changes needed for this issue.
oops... hadn't checked on the changes you've made to master. Should I be updating my branch now and redoing my PR? or wait until you've checked the PR?
Add the programme name in the sidebar in front of the episode name Example![image](https://user-images.githubusercontent.com/1731666/33547737-36ce2142-d939-11e7-87d2-7216e308a971.png)
suggested change for main.cs 1/ add at line 755
Model.Programme progInfo = new Model.Programme(info.Progid);
2/ amend line 829 add
progInfo.Name + " - " +
in front of first parameter e.g.this.SetSideBar(progInfo.Name + " - " + TextUtils.StripDateFromName(info.Name, info.Date), infoText, Model.Episode.GetImage(epid));