Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Maggard <jmaggard@users.sourceforge.net>2010-06-04 02:00:48 +0400
committerJustin Maggard <jmaggard@users.sourceforge.net>2010-06-04 02:00:48 +0400
commiteef8034d4157e63b2639ed704b35baca86a77fde (patch)
treef25fae8e23f2a6a3fef22f2b622e917920be6775 /tivo_commands.c
parentc11e5143e111a57dbe9dfa25c1c02f430a5373f1 (diff)
* Send the comment field as program description when sharing TiVo items.
* Separate out Title from EpisodeTitle.
Diffstat (limited to 'tivo_commands.c')
-rw-r--r--tivo_commands.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/tivo_commands.c b/tivo_commands.c
index d53e70b..e977836 100644
--- a/tivo_commands.c
+++ b/tivo_commands.c
@@ -151,7 +151,8 @@ int callback(void *args, int argc, char **argv, char **azColName)
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
passed_args->size += ret;
}
- if( comment ) {
+ if( comment )
+ {
ret = sprintf(str_buf, "<Caption>%s</Caption>", comment);
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
passed_args->size += ret;
@@ -159,13 +160,26 @@ int callback(void *args, int argc, char **argv, char **azColName)
}
else if( strncmp(mime, "video", 5) == 0 )
{
+ char *episode;
flags |= FLAG_NO_PARAMS;
flags |= FLAG_VIDEO;
ret = sprintf(str_buf, "<Item><Details>"
"<ContentType>video/x-tivo-mpeg</ContentType>"
"<SourceFormat>%s</SourceFormat>"
- "<SourceSize>%s</SourceSize>"
- "<EpisodeTitle>%s</EpisodeTitle>", mime, size, title);
+ "<SourceSize>%s</SourceSize>", mime, size);
+ memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
+ passed_args->size += ret;
+ episode = strstr(title, " - ");
+ if( episode )
+ {
+ ret = sprintf(str_buf, "<Title>%.*s</Title>"
+ "<EpisodeTitle>%s</EpisodeTitle>",
+ episode-title, title, episode+3);
+ }
+ else
+ {
+ ret = sprintf(str_buf, "<Title>%s</Title>", title);
+ }
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
passed_args->size += ret;
if( date )
@@ -177,6 +191,12 @@ int callback(void *args, int argc, char **argv, char **azColName)
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
passed_args->size += ret;
}
+ if( comment )
+ {
+ ret = sprintf(str_buf, "<Description>%s</Description>", comment);
+ memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
+ passed_args->size += ret;
+ }
}
else
{