The 32nd Edinburgh International TV Festival brought together almost 2,000 executives, celebrities and pundits to discuss the state of the television industry, and to look ahead to new shows and innovations.
The BBC News website's Kevin Young attended the event, writing about the main talking points from the executives and stars.
SUNDAY, 26 AUGUST: 1700 BST
The festival is drawing to a close so it's time to sign off. A quick word with the two men overseeing this year's event suggests it has gone well from their point of view.
"We're extremely lucky in that all the big issues came together at the right moment," Newsnight editor Peter Barron said. "It really was the moment to have a festival."
Tim Hincks, chief creative officer at Big Brother producer Endemol, added there had been a risk that everyone would be "very down-in-the-mouth and very hard on themselves" after recent scandals in the TV industry.
"But people have started to discuss how to how we deal with some of the big issues and how to get it in proportion," he said.
He added that the festival was "the most forward-looking digital conference for many years" in terms of embracing new technologies, which was been "a great satisfaction to me".
As we Scots say, it's been braw. See you next year.
SUNDAY, 26 AUGUST: 1645 BST
Novelist Lionel Shriver laid into the TV industry in a festival speech, saying British channels were going downhill and often "patronised" viewers.
"When I was raised in the US I was brought up to revere British TV," the author of We Need to Talk About Kevin told executives.
Lionel Shriver won the Orange Prize in 2005
"I long associated British TV with quality. I have lived in the UK for 20 years and during that time I have seen that quality deteriorate."
She referred to the licence fee by saying: "I really resent paying my money for nothing but property shows that you don't want to watch."
And she described viewers as being "smarter, more sophisticated and more hungry for real information" than broadcasters realised.
"It used to be that the contrast between engaging British television and the trash
on American TV was shocking. Now the similarity is shocking."
But she added that British news bulletins were "streets ahead" of the US.
SUNDAY, 26 AUGUST: 1530 BST
David Duchovny's new drama Californication - made by US network Showtime and coming to the UK on Five - was fantastic, all the more so for being utterly politically incorrect.
David Duchovny (front) plays a frustrated, foul-mouthed sleazebag
We were shown the first half-hour episode and met Hank, a novelist with a battered old convertible and writer's block, who described how he was "disgusted with my life and myself - but I'm not unhappy about that".
The nudity count was high - Hank sleeps with four women in the first programme alone.
Duchovny's portrayal of this frustrated, foul-mouthed sleazebag is a universe away from his UFO drama The X Files - but he is outstanding.
The star of the show, however, could turn out to be Hank's 12-year-old daughter Becca, played by Madeleine Martin, who seemed to have all the wisdom her father was sorely lacking.
SUNDAY, 26 AUGUST: 1300 BST
An entertaining session on TV current affairs saw Peter Taylor recalling the mid-1970s, when he was a reporter on primetime ITV series This Week.
Audience figures had dropped by about a quarter and "a cloud of gloom descended over the team".
Clips were taken out of context, Panorama's John Sweeney insisted
"Don't worry about the ratings," Thames programme controller Jeremy Isaacs told them. "The ratings are my problem.
"I've got Mad About the House, I've got The Sweeney, I've got George and Mildred. Do what you think you ought to be doing."
Taylor's point was that this sort of attitude would never be present today in an industry where high viewing figures are everything.
Ann Widdecombe called for more time at the end of documentaries to discuss "solutions" to problems highlighted in the shows.
And there was a funny moment when ITV1 controller of current affairs Jeff Anderson explained why he had recruited the Conservative MP to front a series on social issues.
She had given a voice to "Middle England" and represented "a huge swathe of public opinion", he said, even though "a lot of people, certainly the critics, would rather drink battery acid than share her views".
I think this was meant as a compliment.
John Sweeney was also good value, saying he and the Queen "ought to meet up" because they had both been victims of misleading editing.
The Church of Scientology had uploaded clips of him to YouTube that were way "out of context", the famously hot-tempered Panorama reporter complained.
SUNDAY, 26 AUGUST: 1030 BST
A lovely, sunny start to the final day of the festival, and a few bleary eyes around me as TV industry folk haul themselves out of bed after the traditional Saturday night of schmoozing and parties.
But Kirsty Wark appears pleased to see a couple of hundred of us at the first session of the day, a focus on the state of the BBC, saying only 40 people turned up to the same discussion last year.
I'm looking forward to a session later this morning on the future of current affairs.
It will feature Conservative MP Ann Widdecombe - the star of ITV1 series Ann Widdecombe Versus the Hoodies - plus veteran BBC presenter Peter Taylor and Panorama's John Sweeney.
Sweeney is the man who famously shouted at an interviewee during a documentary on Scientology, which earned him criticism but also led to a boost in the ratings.
As a big fan of US drama, I'm also going to attend a screening of David Duchovny's new US series Californication.
The former X Files star plays a "troubled" novelist whose life revolves around drink, drugs and sex - and Five, which has signed up the show for the UK, clearly has high hopes for this in its autumn schedule.
SATURDAY, 25 AUGUST: 2045 BST
After all his recent problems, BBC One controller Peter Fincham looked thrilled to collect the award for terrestrial channel of the year at the festival's annual awards, presented this year by radiant mum-to-be Lauren Laverne.
One of Mr Fincham's biggest shows, Doctor Who, was also named best programme, and in his speech, he hailed "mainstream television", saying that it was "here to stay".
Some good news for Peter Fincham, controller of BBC One
Meanwhile ITV2 - home of Entourage, The Office: An American Workplace and celebrity couple Katie "Jordan" Price and Peter Andre - took the prize for non-terrestrial channel.
So that's it from day two of the festival - more tomorrow, assuming I manage to sleep through the wedding reception currently in full swing two floors below me in my hotel...
SATURDAY, 25 AUGUST: 1830 BST
A session about whether there was too much sex on TV (I attended entirely for journalistic reasons, you understand) saw the appearance on Abi Titmuss, dressed from head-to-upper thigh in black.
She said she had been told her home sex video "sold more than Shrek on the black market in Scotland".
But the former nurse stressed she was "not ashamed" of her infamy, as she "was not exploited in any way".
Also on the panel was Boyd Hilton, TV editor of Heat magazine. He argued that violence on TV was more of an issue than sex, and more likely to corrupt youngsters' minds.
"When Wire in the Blood has a really gory, sickeningly violent scene in the first 30 seconds, that's more shocking to me than anything else I've seen," he said, referring to the ITV1 drama starring Robson Green.
SATURDAY, 25 AUGUST: 1730 BST
Wearing a tartan tracksuit and white trainers and chomping on one of his trademark cigars (unlit, of course, in these days of smoking bans), Sir Jimmy Savile starred in a special festival edition of Jim'll Fix it.
Jim arranged for Dawn Airey, the former BSkyB director, to appear as an extra in Coronation Street.
Sir Jimmy appeared with presenter-turned-comedian Kirsten O'Brien
A production assistant from an independent company became Austin Powers so she could dance like the International Man of Mystery.
But the highlight was an appearance by 1970s crooner David Soul, who performed his big hit Don't Give Up On Us Baby with Jo, a lucky fan from the TV industry.
There seemed to be a lot of goodwill towards Sir Jimmy from the audience, perhaps looking back fondly to their own requests for "fix its" in their childhoods.
Mind you, I've always resented Sir Jimmy since he ignored my request to present the Top 40 show on BBC Radio 1 when I was nine.
SATURDAY, 25 AUGUST: 1700 BST
The attitudes of young American TV viewers are changing dramatically, according to Jane Root, a former controller of BBC Two who now runs the US version of The Discovery Channel.
She offered an insight at a festival session into her network's belief that "the strapping athletic jock, so long the role-model and object of desire, has lost out to the studious, clever geek".
Ratings on her documentary-led network were growing, she claimed, because people now felt that knowing things was more "cool" than looking good or being trendy.
"This new audience wants knowledge because it makes them feel alive, feel connected, feel sexy," she said, adding that this was a gap in the market that Discovery could fill.
She dubbed many people in this group "insatiables" and said they dreamt of being "the next Mark Zuckerberg" - a reference to the founder of social-networking site Facebook - and "billionaires in their twenties".
She also reassured any former UK colleagues worried about the reputation of the TV industry that recent scandals about trust had been "a non-story in the US".
"We have vital issues like Paris Hilton and Lindsay Lohan, and some stuff going on in the Middle East, that kind of takes precedence," she quipped.
SATURDAY, 25 AUGUST: 1530 BST
TV director Ursula Macfarlane is trying to drum up support at the festival for Storyville, a factual documentary strand on BBC Two and BBC Four.
It's a programme that generally covers issues outside the UK - Spike Lee's four-hour film about the impact of Hurricane Katrina on New Orleans, When the Levees Broke, is showing this week in that slot, for instance.
Nick Fraser has been in charge of the Storyville strand since 1997
"There is very reliable evidence that the budget is being cut dramatically," Macfarlane says, describing this as "a big body blow" that would drastically reduce the number of documentaries commissioned.
An online petition with more than 2,300 signatures appeals to BBC director general Mark Thompson to protect the strand's annual £2m budget.
"It's one of the jewels in the crown and it's what public service broadcasting is all about," Macfarlane adds.
"It's risky, it's innovative, it doesn't always work but in a way, that's the point - if you don't take risks, you'll never break any boundaries."
In response, the BBC has said "no decision has been made on budgets yet", with a spokeswoman insisting are "no plans" to change the way Storyville commissions films.
SATURDAY, 25 AUGUST: 1430 BST
"I definitely hope we will screen the series," was the response of BBC One controller Peter Fincham when asked if his channel's forthcoming documentary on the Queen would ever see the light of day.
You'll remember the recent front-page fuss when it emerged that a trailer had been edited to suggest Her Majesty had stormed out of a photo shoot. She had not.
Peter Fincham originally said the Queen walked out "in a huff"
Perhaps I'm reading too much into his remark, but it seems to suggest there is a chance that the programme may not be shown.
It wasn't exactly a confident endorsement, anyway.
Mr Fincham was another BBC manager who insisted he was unable to say much about the recent scandals until an inquiry by former executive Will Wyatt was over.
I have to say it's getting a bit boring hearing Mr Wyatt's name used in this "on-message" way all weekend.
Elsewhere in the session, Mr Fincham described the loss of Australian soap Neighbours as "unexpected and unwished for" but promised its replacement - as yet undecided - would be "a turning point" for daytime TV.
SATURDAY, 25 AUGUST: 0920 BST
If you're a fan of digital channel E4, you'll have seen the trailers featuring a purple-clad band, merrily bopping along.
Reality TV: E4's trailers come to life as the band plays in the street
The group have brought their natty suits and lounge jazz to Edinburgh, and have been dancing away outside the Underbelly comedy venue in Bristo Square.
This location has been sponsored by E4 and turned into the "Udderbelly".
It's hard to miss if you're in the city this weekend - just look out for the enormous inflatable purple cow, lying on its back with its udders in the air.
It's bringing a bit of colour to the site, which is normally part of the University of Edinburgh.
SATURDAY, 25 AUGUST: 0830 BST
So it's day two of the festival, and one of the most high-profile sessions of the weekend is being held this morning.
Newsnight's Kirsty Wark is interviewing Gerry McCann about the relationship he and his family have had with the media since the disappearance of his daughter Madeleine in Portugal in May.
Then it's time for the controller of BBC One, Peter Fincham, to be grilled by Panorama and BBC Radio 2 presenter Jeremy Vine.
Normally this would be a fairly straightforward discussion of programmes and prospects - but Fincham is the man who stood before journalists at a press launch and said the trailer for a new documentary showed the Queen walking out of a photo shoot "in a huff".
Of course, this turned out to be anything but fact, and the controller found himself appearing on his own channel to apologise.
FRIDAY, 24 AUGUST: 2200 BST
Newsnight's Jeremy Paxman gave the James MacTaggart Memorial Lecture, a high-profile festival speech which rarely lacks controversy.
As well as warning that Newsnight's future was under threat owing to BBC cutbacks, the presenter responded to Tony Blair's speech in June, when the former prime minister said the media could operate as "a feral beast".
"We do not need to take seriously complaints about the marginalisation of Parliament from a prime minister who could hardly be bothered to turn up there much of the time," Paxman said.
"Nor need we concern ourselves with complaints about the trivialisation of Cabinet government from a man whose Cabinet meetings could last less time than an edition of Ready Steady Cook.
"We do not need lectures about cynicism from an administration which employed people who believed that September 11th was a good day to bury bad news."
He added: "Most of all, we do not need homilies about destroying people's reputations from an administration on whose watch [government scientist] Dr David Kelly was driven to suicide."
There were a number of far more light-hearted quips as well.
He earned the biggest laugh of his 90-minute appearance by admitting there were quiet news days when he sat on the Newsnight set wanting to tell viewers: "Not much has happened today - I'd go to bed if I were you."
FRIDAY, 24 AUGUST: 1650 BST
A session on trust in television saw directors at the BBC, ITV and Channel 4 staying very much "on-message".
The BBC's Jana Bennett and ITV director of programmes Simon Shaps would not comment in detail on their recent scandals until reports on the mistakes were published.
Channel 4's Andy Duncan acknowledged "unacceptable" errors were made by producers who ran unwinnable quizzes, and described his fears that viewers' confidence in broadcasters had been undermined.
But he was keen to stress that the row about alleged racism in Celebrity Big Brother had been "an offence issue", rather than "a trust issue", with viewers feeling let down by the contestants, instead of feeling deceived by Channel 4.
Tim Hincks of Big Brother producer Endemol said he was concerned about the level of audience outrage following that row - a record 45,000 viewers contacted regulator Ofcom.
"What's important is the amount of people who complained. You just have to respect that. Respect the viewers," he said.
Those on the panel also agreed that greater transparency was a good way forward, explaining when things have gone wrong instead of faking scenes.
"I don't think the audience does expect perfect outcomes. They'd like the lid to be lifted," said Bennett.
FRIDAY, 24 AUGUST: 1545 BST
Five seems to have gone the other way to Channel 4 by trumpeting the imported series it will feature in its autumn schedule.
Forensics show CSI: Crime Scene Investigates returns, along with legal drama Law and Order: SVU.
It is also giving a terrestrial airing to Dirt, starring Courteney Cox as a magazine editor, and will air David Duchovny's new X-rated drama Californication.
There's a new investigative series with Donal MacIntyre looking at street crime.
And if your idea of a good evening's viewing is watching "real people with real issues", then happily there's plenty to keep you occupied.
Sweaty Betty will tackle extreme sweating - "the last female taboo", according to Five - while Serial Brides features women "who love the wedding more than the marriage".
Meanwhile My Body Hell is to deal with the best ways to get rid of unwanted hair, cellulite and getting better bottoms.
Sadly this is aimed at women, though, so it looks like I won't be able to tune in for toning tips after eating all that tablet.
FRIDAY, 24 AUGUST: 1345 BST
Channel 4 has created a buzz before the festival has even begun by announcing it's to scrap Celebrity Big Brother following this year's row about alleged racism.
People in the queue for the opening session were telling each other the news, announced at a press conference, and I heard a couple of gasps of "oh, really?" - so it obviously came as a surprise to those people.
The broadcaster which brought Friends, Frasier, Lost and ER to UK viewers is also to spend less on imported programming and put the money towards home-grown shows.
And if you're a fan of You Are What You Eat or Selling Houses Abroad, for instance, then Channel 4 insists they're not coming back, as it shakes up its schedule.
FRIDAY, 24 AUGUST: 1200 BST
It's been an awkward year for those working in the TV industry.
The TV festival comes at the end of Edinburgh's festival season
Over and over again, they've had to admit to mistakes and justify their practices on issues such as the phone-in quizzes which viewers stood no chance of winning, or the misleading editing of supposed "reality" shows.
There was also the row over alleged racism on Celebrity Big Brother and, behind the scenes, a high-profile defection when the BBC's Michael Grade became chairman of ITV.
Many of the people involved or overseeing these events are here in Edinburgh, and the issue of trust appears likely to come up repeatedly this weekend.
There are also household names to look out for - Jeremy Paxman, giving a rare public speech; his Newsnight colleague Kirsty Wark interviewing Gerry McCann about being in the spotlight since the disappearance of his daughter Madeleine; and even Sir Jimmy Savile, with a special "fix it" session for TV folk.
I've stocked up on the sickly-sweet local snack tablet - a giddy mix of sugar, condensed milk and then more sugar - to keep my adrenaline pumping throughout the next three days.
So let's see what the industry has to say for itself.