Having a number of listeners and downloads for stored episodes and shows can be useful internally and externally both
In our schema we already have download_count we don't use it however. On each successful request to the episode download endpoint we should increment this value and commit it to db
We need to expand our schema and introduce listening_count which I think is missing.
These both should be stored as integer
download_count & listening_count should both be added to our serialisation dumps for episodes.
We might introduce a class method on shows objects that collect the counts of all episodes hosted by the show. In that case that is not part of the model as we expect that adding all selected rows would not be a huge performance hit. If it is we should expand the show schema.
In either case show-serialisation has to include the totalled counts.
Having a number of listeners and downloads for stored episodes and shows can be useful internally and externally both
In our schema we already have
download_countwe don't use it however. On each successful request to the episode download endpoint we should increment this value and commit it to dbWe need to expand our schema and introduce
listening_countwhich I think is missing.These both should be stored as
integerdownload_count&listening_countshould both be added to our serialisation dumps for episodes.We might introduce a class method on shows objects that collect the counts of all episodes hosted by the show. In that case that is not part of the model as we expect that adding all selected rows would not be a huge performance hit. If it is we should expand the show schema.
In either case show-serialisation has to include the totalled counts.