summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <arch@njw.me.uk>2007-05-05 18:41:23 +0000
committerNick White <arch@njw.me.uk>2007-05-05 18:41:23 +0000
commitf3cff53f92bc49125fb97ccf752cf194e3e7a730 (patch)
treec348c84b0b1f5acb24652324a44a7238ab019509
parent08debe732cb253c6a4386f37caca3459b326e68f (diff)
Fixed media sorting bug, added date view to listings
Fixed bug causing issues containing only media to not be sorted correctly Added display of issue date when -vv is passed with -l or -m git-archimport-id: getht@sv.gnu.org/getht--mainline--0.1--patch-26
-rw-r--r--src/cli.c9
-rw-r--r--src/mediaxml.c2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/cli.c b/src/cli.c
index 51ba380..56ccc9d 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -33,6 +33,8 @@ void list_issues(iss ** issue, int no_of_issues, int verbose)
{
printf("[%i]\t", iss_no);
printf("%s\n", issue[iss_no]->title);
+ if(verbose >= 2)
+ printf("Year: %i; Months: %i - %i\n",issue[iss_no]->date.year,issue[iss_no]->date.firstmonth,issue[iss_no]->date.lastmonth);
if(verbose >= 1)
{
for(sec_no=0; sec_no<=issue[iss_no]->no_of_sections; sec_no++)
@@ -65,6 +67,8 @@ void list_media(iss ** issue, int no_of_issues, int verbose)
if(issue[iss_no]->no_of_media >= 0)
{
printf("%s\n", issue[iss_no]->title);
+ if(verbose >= 2)
+ printf("Year: %i; Months: %i - %i\n",issue[iss_no]->date.year,issue[iss_no]->date.firstmonth,issue[iss_no]->date.lastmonth);
for(med_no=0; med_no <= (issue[iss_no]->no_of_media); med_no++, med_global++)
{
printf("[%i]\t", med_global);
@@ -72,8 +76,11 @@ void list_media(iss ** issue, int no_of_issues, int verbose)
if(verbose >= 1)
{
printf("\t%s\n", issue[iss_no]->media[med_no]->uri);
- if(verbose >=2 && issue[iss_no]->media[med_no]->comment[0]!='\0')
+ if(verbose >=2)
+ {
+ if(issue[iss_no]->media[med_no]->comment[0]!='\0')
printf("\t%s\n", issue[iss_no]->media[med_no]->comment);
+ }
}
}
}
diff --git a/src/mediaxml.c b/src/mediaxml.c
index bcb2da1..02c2cad 100644
--- a/src/mediaxml.c
+++ b/src/mediaxml.c
@@ -240,7 +240,7 @@ iss ** parsemedia(char * filepath, iss ** issue, int * no_of_issues)
xmlFreeDoc(media_file);
- issuesort(issue, no_of_issues);
+ issuesort(issue, *no_of_issues);
return issue;
}