How to set default colour for recorded and pre-recorded shows
  • Is there a way to make Airtime 2.5.1 default to using only two colours for shows entered into the calendar? We would like to have all pre-recorded shows in blue, and all live/recorded shows in red.

    thanks for any pointers on this.

    James
  • 10 Comments sorted by
  • I have a little cron job that changes the show colors by genre in the calendar views. I guess that could be modified? I could not imagine anyone working without this :/

    image
    Post edited by John Chewter at 2014-08-13 04:49:18
    No longer using Airtime or Libretime.
  • Note I also added a 'Genre' drop-down to New/Update Show to make this more convenient.

    My Bash Script for the cron:

    #!/bin/sh

    set -e
    set -u

    # Set these environmental variables to override them,
    # but they have safe defaults.
    export PGHOST=localhost
    #export PGPORT=${PGPORT-5432}
    export PGDATABASE=airtime
    export PGUSER=airtime
    export PGPASSWORD=airtime

    RUN_PSQL='psql -X --set AUTOCOMMIT=off --set ON_ERROR_STOP=on '

    ${RUN_PSQL} <<SQL
    UPDATE cc_show SET color = '000000', background_color = 'ffaaff' WHERE genre = 'Alt-History';
    UPDATE cc_show SET color = '000000', background_color = 'd9d9d9' WHERE genre = 'Conspiracy';
    UPDATE cc_show SET color = '000000', background_color = 'd9d9d9' WHERE genre = 'Geopolitics';
    UPDATE cc_show SET color = '000000', background_color = 'd9d9d9' WHERE genre = 'Conspiracies';
    UPDATE cc_show SET color = '000000', background_color = 'ffff44' WHERE genre = 'Cryptids';
    UPDATE cc_show SET color = '000000', background_color = '44ff44' WHERE genre = 'Ecology';
    UPDATE cc_show SET color = '000000', background_color = '9cf0ff' WHERE genre = 'Education';
    UPDATE cc_show SET color = '000000', background_color = '9898b0' WHERE genre = 'Esoterica';
    UPDATE cc_show SET color = '000000', background_color = 'ffbfff' WHERE genre = 'History';
    UPDATE cc_show SET color = '000000', background_color = 'ffba44' WHERE genre = 'Myths';
    UPDATE cc_show SET color = '000000', background_color = 'ffc787' WHERE genre = 'Mysteries';
    UPDATE cc_show SET color = 'ffffff', background_color = '6a6aff' WHERE genre = 'News';
    UPDATE cc_show SET color = '000000', background_color = 'cfcfff' WHERE genre = 'Science';
    UPDATE cc_show SET color = '000000', background_color = 'ff7777' WHERE genre = 'Security';
    UPDATE cc_show SET color = '000000', background_color = 'ff44ff' WHERE genre = 'Skepticism';
    UPDATE cc_show SET color = '000000', background_color = 'bfffff' WHERE genre = 'Spiritual';
    UPDATE cc_show SET color = '000000', background_color = 'ffffaa' WHERE genre = 'UFO-Aliens';
    UPDATE cc_show SET color = '000000', background_color = 'ffffaa' WHERE genre = 'UFO/Aliens';
    UPDATE cc_show SET color = '000000', background_color = '79ffce' WHERE genre = 'Health';
    UPDATE cc_show SET color = '000000', background_color = 'eeeeee' WHERE genre = '-';
    COMMIT;
    SQL

    Post edited by John Chewter at 2014-08-13 04:56:30
    No longer using Airtime or Libretime.
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi James, live shows set up for recording from the soundcard are already distinguished by a black icon with a red dot in the title bar, see:

    http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/calendar/static/Screenshot92-Record_and_rebroadcast_icons.png

    In standard Airtime, the background colour is based on a hash of the show name.

    Cheers!

    Daniel 

  • For program planning - I find this pseudo random coloring of the shows VERY confusing, unhelpful and messy- hence my hack above. I plan my talk shows by timeslot/genre eg UFO Hour - from different show providers - and the shows can change daily within a time slot. Now my shows all sit there like soldiers in a row. I can see at a glance that I need to schedule an Alternative News program (from one of 4 providers) in a slot - or if a show is out of place.
    Post edited by John Chewter at 2014-08-13 05:21:11
    No longer using Airtime or Libretime.
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi John, this sort of thing does vary from station to station. Considering a station like BBC Radio 4, some of the show names outlive the people that created them!

    I think it would be feasible to have a system preference to colour code shows by name or genre - please open a ticket for that, if you think it would be useful for other stations.

    Cheers!

    Daniel
  • I did, a long time ago and talked about it with Albert S. who seemed to like it - but he has bigger and moe urgent fish to fry. What annoys me with the Add Show/Update form is that if you put a color in the show at add time - it completely ignores it and does it's hash color thing - then you have to edit to change it again. My little hack runs every 10 mins and just burbles away and if I add a new genre its just one more line to add. Its enough I think.

    Radio 4 always has different comedy shows at 6:30pm every weekday - so marking comedy as, say, red can be very useful.
    Post edited by John Chewter at 2014-08-13 05:57:03
    No longer using Airtime or Libretime.
  • Thanks John for the script - looks like something like this might work for us. Ideally we would cross reference the cc_show_instance table with the cc_show table to only alter those shows that are either marked 'record' or 'rebroadcast'.

    Would be grateful of any sql scripts to do this!
  • Its just a postgres table join at the top.
    No longer using Airtime or Libretime.
  • Thanks for the pointer on this John. For any others interested, this is my script:

    #!/bin/sh

    set -e
    set -u

    # Set these environmental variables to override them,
    # but they have safe defaults.
    export PGHOST=localhost
    #export PGPORT=${PGPORT-5432}
    export PGDATABASE=airtime
    export PGUSER=airtime
    export PGPASSWORD=airtime

    RUN_PSQL='psql -X --set AUTOCOMMIT=off --set ON_ERROR_STOP=on '

    ${RUN_PSQL} <<SQL
    UPDATE cc_show SET color = 'ffffff', background_color = '0000ff' WHERE id IN (SELECT DISTINCT show_id FROM cc_show_instances WHERE rebroadcast = 0 AND record = 0);
    UPDATE cc_show SET color = 'ffffff', background_color = 'ff0000' WHERE id IN (SELECT DISTINCT show_id FROM cc_show_instances WHERE rebroadcast = 1 OR record = 1);
    COMMIT;
    SQL

  • Hi

    Nice discussion, so personally I will prefer a select box menu with color (5-10).

    Thanks