- } else if (strcasecmp(ua->argk[i], _("media")) == 0 ||
- strcasecmp(ua->argk[i], _("volumes")) == 0) {
- bool done = false;
- for (j=i+1; j<ua->argc; j++) {
- if (strcasecmp(ua->argk[j], _("job")) == 0 && ua->argv[j]) {
- bstrncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH);
- jr.JobId = 0;
- db_get_job_record(ua->jcr, ua->db, &jr);
- jobid = jr.JobId;
- } else if (strcasecmp(ua->argk[j], _("jobid")) == 0 && ua->argv[j]) {
- jobid = str_to_int64(ua->argv[j]);
- } else {
- continue;
- }
- VolumeName = get_pool_memory(PM_FNAME);
- n = db_get_job_volume_names(ua->jcr, ua->db, jobid, &VolumeName);
- bsendmsg(ua, _("Jobid %d used %d Volume(s): %s\n"), jobid, n, VolumeName);
- free_pool_memory(VolumeName);
- done = true;
- }
- /* if no job or jobid keyword found, then we list all media */
- if (!done) {
- int num_pools;
- uint32_t *ids;
- /* Is a specific pool wanted? */
- for (i=1; i<ua->argc; i++) {
- if (strcasecmp(ua->argk[i], _("pool")) == 0) {
- if (!get_pool_dbr(ua, &pr)) {
- bsendmsg(ua, _("No Pool specified.\n"));
- return 1;
- }
- mr.PoolId = pr.PoolId;
- db_list_media_records(ua->jcr, ua->db, &mr, prtit, ua, llist);
- return 1;
- }
- }
- /* List Volumes in all pools */
- if (!db_get_pool_ids(ua->jcr, ua->db, &num_pools, &ids)) {
- bsendmsg(ua, _("Error obtaining pool ids. ERR=%s\n"),
- db_strerror(ua->db));
- return 1;
- }
- if (num_pools <= 0) {
- return 1;
- }
- for (i=0; i < num_pools; i++) {
- pr.PoolId = ids[i];
- if (db_get_pool_record(ua->jcr, ua->db, &pr)) {
- bsendmsg(ua, _("Pool: %s\n"), pr.Name);
- }
- mr.PoolId = ids[i];
- db_list_media_records(ua->jcr, ua->db, &mr, prtit, ua, llist);
- }
- free(ids);
- return 1;
- }
- /* List a specific volume */
- } else if (strcasecmp(ua->argk[i], _("volume")) == 0) {
- if (!ua->argv[i]) {
- bsendmsg(ua, _("No Volume Name specified.\n"));
- return 1;
- }
- bstrncpy(mr.VolumeName, ua->argv[i], sizeof(mr.VolumeName));
- db_list_media_records(ua->jcr, ua->db, &mr, prtit, ua, llist);
- return 1;
+ } else if (strcasecmp(ua->argk[i], NT_("media")) == 0 ||
+ strcasecmp(ua->argk[i], NT_("volume")) == 0 ||
+ strcasecmp(ua->argk[i], NT_("volumes")) == 0) {
+ bool done = false;
+ for (j=i+1; j<ua->argc; j++) {
+ if (strcasecmp(ua->argk[j], NT_("ujobid")) == 0 && ua->argv[j]) {
+ bstrncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH);
+ jr.JobId = 0;
+ db_get_job_record(ua->jcr, ua->db, &jr);
+ jobid = jr.JobId;
+ } else if (strcasecmp(ua->argk[j], NT_("jobid")) == 0 && ua->argv[j]) {
+ jobid = str_to_int64(ua->argv[j]);
+ } else {
+ continue;
+ }
+ VolumeName = get_pool_memory(PM_FNAME);
+ n = db_get_job_volume_names(ua->jcr, ua->db, jobid, &VolumeName);
+ ua->send_msg(_("Jobid %d used %d Volume(s): %s\n"), jobid, n, VolumeName);
+ free_pool_memory(VolumeName);
+ done = true;
+ }
+ /* if no job or jobid keyword found, then we list all media */
+ if (!done) {
+ int num_pools;
+ uint32_t *ids;
+ /* List a specific volume? */
+ if (ua->argv[i]) {
+ bstrncpy(mr.VolumeName, ua->argv[i], sizeof(mr.VolumeName));
+ db_list_media_records(ua->jcr, ua->db, &mr, prtit, ua, llist);
+ return 1;
+ }
+ /* Is a specific pool wanted? */
+ for (i=1; i<ua->argc; i++) {
+ if (strcasecmp(ua->argk[i], NT_("pool")) == 0) {
+ if (!get_pool_dbr(ua, &pr)) {
+ ua->error_msg(_("No Pool specified.\n"));
+ return 1;
+ }
+ mr.PoolId = pr.PoolId;
+ db_list_media_records(ua->jcr, ua->db, &mr, prtit, ua, llist);
+ return 1;
+ }
+ }
+
+ /* List Volumes in all pools */
+ if (!db_get_pool_ids(ua->jcr, ua->db, &num_pools, &ids)) {
+ ua->error_msg(_("Error obtaining pool ids. ERR=%s\n"),
+ db_strerror(ua->db));
+ return 1;
+ }
+ if (num_pools <= 0) {
+ return 1;
+ }
+ for (i=0; i < num_pools; i++) {
+ pr.PoolId = ids[i];
+ if (db_get_pool_record(ua->jcr, ua->db, &pr)) {
+ ua->send_msg(_("Pool: %s\n"), pr.Name);
+ }
+ mr.PoolId = ids[i];
+ db_list_media_records(ua->jcr, ua->db, &mr, prtit, ua, llist);
+ }
+ free(ids);
+ return 1;
+ }