Sonos Itemtype and item content for list of podcasts and episodes - sonos

We have several podcasts, each with multiple episodes. Which itemtype should we return for the podcasts and episodes and which type should the item be?
We currently use itemtype.collection for the list of podcasts and episodes and each episode has itemtype.stream and the item is then set to streamMetadata.
This does however not allow for scrubbing.
Podcast:
var mediaData = new mediaCollection()
{
id = string.Format({0}:{1}:{2}",Prefix, moodId, moodItem.Id),
title = moodItem.Id,
itemType = itemType.collection,
onDemand = true,
liveNow = false,
language = "Norwegian",
liveNowSpecified = false,
albumArtURI = new albumArtUrl() { Value = moodItem.ImageUri.ToString(), requiresAuthentication = false, requiresAuthenticationSpecified = false}
};
Episode:
return new mediaMetadata
{
id = string.Format("{0}:{1}:{2}:{3}", Prefix, moodId, podcast.Id, episode.Publishdate.Ticks.ToString()),
title = episode.Title,
itemType = itemType.stream,
mimeType = "audio/mpeg",
onDemand = true,
onDemandSpecified = true,
language = "Norwegian",
Item = new streamMetadata()
{
currentShow = episode.Title,
logo = new albumArtUrl { Value = podcast.ImageUri.ToString(), requiresAuthentication = false, requiresAuthenticationSpecified = true },
currentHost = "Someone",
}
};

Your getMetadataResponse for podcasts should be of itemType track and should include canResume true. Check out this page for specific information and examples.

Related

How to create invoice in netsuite using suitetalk?

Thanks for reading this topic, i would appreciate if someone from netsuite can share with me solution of below issue.
I am creating invoice in netsuite web portal with the customer that doesn't have credit limit, i have added inventory item and then payment item of that items it's working very well and i am very happy. but when i am going to create the same thing using suitetalk webservices it's showing me below error.
[Code=USER_ERROR] Customer balance exceeds credit limit
[Code=WARNING] Customer balance of 23.52 exceeds credit limit of 0.01.
[Code=WARNING] Customer balance of 23.52 exceeds credit limit of 0.01.
please have a look the source code:
Invoice invoice = new Invoice();
invoice.entity = new RecordRef() { internalId = "5967", type = RecordType.customer, typeSpecified = true };
invoice.tranDate = DateTime.UtcNow;
invoice.memo = "TEST0001";
invoice.department = new RecordRef() { internalId = "2", type = RecordType.department, typeSpecified = true };
invoice.location = new RecordRef() { internalId = "1", type = RecordType.location, typeSpecified = true };
InvoiceItemList invoiceItemList = new InvoiceItemList();
List<InvoiceItem> invoiceItems = new List<InvoiceItem>();
// payment item
invoiceItems.Add(new InvoiceItem()
{
item = new RecordRef() { internalId = "62374" },
rate = (25 * -1).ToString(),
price = new RecordRef() { internalId = "-1", type = RecordType.priceLevel, typeSpecified = true },
taxCode = new RecordRef() { internalId = "16", type = RecordType.taxGroup, typeSpecified = true }
});
// inventory or other items
InvoiceItem invoiceItem = new InvoiceItem();
invoiceItem.item = new RecordRef() { internalId = "59852" };
invoiceItem.rate = "25";
invoiceItem.quantity = 1;
invoiceItem.quantitySpecified = true;
invoiceItem.taxCode = new RecordRef() { internalId = "16", type = RecordType.taxGroup, typeSpecified = true };
invoiceItem.price = new RecordRef() { internalId = "-1", type = RecordType.priceLevel, typeSpecified = true };
invoiceItems.Add(invoiceItem);
invoiceItemList.item = invoiceItems.ToArray();
invoice.itemList = invoiceItemList;
WriteResponse writeRes = Client.Service.add(invoice);
if (writeRes.status != null && writeRes.status.isSuccess)
{
string baseRef = ((RecordRef)writeRes.baseRef).internalId;
}
else
{
string response = Client.GetStatusDetails(writeRes.status);
MessageBox.Show(response);
}

Importing a contact column into Podio

Which app_id should be used for importing into a contact column? Also, what should the mappings parameter look like?
podio.ImporterService.ImportAppItems(fileId, appId, new List<ImportMappingField> {
new ImportMappingField { FieldId = primaryFieldId, Unique = false, Value = new { column_id = "0" }},
new ImportMappingField { FieldId = contactfieldId, Unique = false, Value = new { column_id = "1", app_id = ???, mappings = new []{ ??? }}}
})
Edit:
I figured it out. Below is an example that works for me.
podio.ImporterService.ImportAppItems(373063497, 18803129, new List<ImportMappingField> {
new ImportMappingField {
FieldId = 148580608,
Unique = false,
Value = new { column_id = "0" }
},
new ImportMappingField {
FieldId = 148580614,
Unique = false,
Value = new {
mappings = new []{
new {
field_key = "mail",
unique = "true",
column_id = "4"
}
}
}
}
});
See the API documentation [1]
[1] https://developers.podio.com/doc/contacts

BotFramework Carousel CardAction Button Doesn't OpenUrl

I have a carousel, but it is not opening the URL when the CardAction button is clicked in Skype. It is working in Emulator though. Is there a reason for this?
foreach(var botAmazonItem in botAmazonItems)
{
List<CardImage> cardImages = new List<CardImage>();
cardImages.Add(new CardImage(url: $"{botAmazonItem.imageUrl}"));
List<CardAction> cardButtons = new List<CardAction>();
CardAction plButton = new CardAction()
{
Value = botAmazonItem.detailsPageUrl,
Type = ActionTypes.OpenUrl,
Title = botAmazonItem.title
};
cardButtons.Add(plButton);
HeroCard plCard = new HeroCard()
{
Title = $"{botAmazonItem.title}",
Subtitle = $"{botAmazonItem.formattedPrice}",
Images = cardImages,
Buttons = cardButtons
};
Attachment plAttachment = plCard.ToAttachment();
replyToConversation.Attachments.Add(plAttachment);
}
Try changing your "value" links to https:// rather than http://. Skype requires all external links to be https://
The following code (based on yours) works:
var botAmazonItems = new List<AmazonBotItem>();
botAmazonItems.Add(new AmazonBotItem() { imageUrl = "http://placekitten.com/200/300", title = "Microsoft", formattedPrice = "$8.95", detailsPageUrl = "https://www.microsoft.com" });
botAmazonItems.Add(new AmazonBotItem() { imageUrl = "http://placekitten.com/300/300", title = "Bot Framework", formattedPrice = "$2.95", detailsPageUrl = "https://www.botframework.com" });
var reply = activity.CreateReply();
reply.AttachmentLayout = AttachmentLayoutTypes.Carousel;
reply.Attachments = new List<Attachment>();
foreach (var botAmazonItem in botAmazonItems)
{
List<CardImage> cardImages = new List<CardImage>();
cardImages.Add(new CardImage(url: $"{botAmazonItem.imageUrl}"));
List<CardAction> cardButtons = new List<CardAction>();
CardAction plButton = new CardAction()
{
Value = botAmazonItem.detailsPageUrl,
Type = ActionTypes.OpenUrl,
Title = botAmazonItem.title
};
cardButtons.Add(plButton);
HeroCard plCard = new HeroCard()
{
Title = $"{botAmazonItem.title}",
Subtitle = $"{botAmazonItem.formattedPrice}",
Images = cardImages,
Buttons = cardButtons
};
Attachment plAttachment = plCard.ToAttachment();
reply.Attachments.Add(plAttachment);
}

jqGrid ASP.NET MVC4 initial sort

I'm using jqGrid as TreeGrid with ASP.NET MVC4 and have one problem:
My Model:
OrdersGrid = new JQGrid
{
Columns = new List<JQGridColumn>()
{
new JQGridColumn
{
DataField = "MeasureId",
// always set PrimaryKey for Add,Edit,Delete operations
// if not set, the first column will be assumed as primary key
PrimaryKey = true,
Visible = false,
Sortable = false
},
new JQGridColumn
{
DataField = "Name",
Width = 100,
Sortable = true
},
new JQGridColumn
{
DataField = "Symbol",
Width = 100
},
},
Width = Unit.Pixel(640),
Height = Unit.Percentage(100),
TreeGridSettings = new TreeGridSettings
{
Enabled = true
},
SortSettings = new SortSettings
{
AutoSortByPrimaryKey = false,
InitialSortColumn = "Name",
InitialSortDirection = SortDirection.Asc
}
};
My Controller:
public JsonResult DataRequested()
{
// Get both the grid Model and the data Model
// The data model in our case is an autogenerated linq2sql database based on Northwind.
var gridModel = new NavigatorModel();
...
var hierarchyRows = from measure in measures
select new
{
MeasureId = measure.MeasureId,
Name = measure.Name,
Symbol = measure.Symbol,
//ParentID = measure.ParentMeasureId != null ? measure.ParentMeasureId.ToString() : "",
tree_loaded = true,
tree_parent = measure.ParentMeasureId,
tree_level =LoadAllRowsExpanded_GetRowLevel(measure.ParentMeasureId, measures),
tree_leaf = LoadAllRowsExpanded_IsLeafRow(measure.MeasureId, measures),
tree_expanded = true
};
//var dataModel = new
// return the result of the DataBind method, passing the datasource as a parameter
// jqGrid for ASP.NET MVC automatically takes care of paging, sorting, filtering/searching, etc
return gridModel.OrdersGrid.DataBind(hierarchyRows.AsQueryable());
}
As above you can see that I'm setting the AutoSortByPrimaryKey set to false, but when the page is loaded, grid looks like that:
When I click on one of columns (Name or Symbol) to sort everything becomes fine - the Measure which is wrongly displayed goes under it's parent.
I have tried also with event to sort after "gridInitialize" but also no success.
Any ideas?

How best to traverse API information with iOS

Is there any easier way of traversing array/dictionaries without creating a lot of separate NSArrays/NSDictionaries? I know you can traverse nested dictionaries with dot notation and value at keypath, but what about when arrays are involved?
For example:
At the moment if I want to get at the object at feed.entry.link[4].href in the API result below, I have to define an array at keypath "feed.entry", then assign its first entry as a dictionary, then define an array at keypath "link" and access its fourth entry as a dictionary, and then access its value at "href".
Is this normal?
received {
encoding = "UTF-8";
feed = {
entry = (
{
author = (
{
name = {
"$t" = swdestiny;
};
uri = {
"$t" = "https://gdata.youtube.com/feeds/api/users/swdestiny";
};
}
);
category = (
{
scheme = "http://schemas.google.com/g/2005#kind";
term = "http://gdata.youtube.com/schemas/2007#video";
},
{
label = Entertainment;
scheme = "http://gdata.youtube.com/schemas/2007/categories.cat";
term = Entertainment;
},
{
scheme = "http://gdata.youtube.com/schemas/2007/keywords.cat";
term = Star;
},
{
scheme = "http://gdata.youtube.com/schemas/2007/keywords.cat";
term = Wars;
},
{
scheme = "http://gdata.youtube.com/schemas/2007/keywords.cat";
term = Episode;
},
{
scheme = "http://gdata.youtube.com/schemas/2007/keywords.cat";
term = 3;
},
{
scheme = "http://gdata.youtube.com/schemas/2007/keywords.cat";
term = Revenge;
},
{
scheme = "http://gdata.youtube.com/schemas/2007/keywords.cat";
term = of;
},
{
scheme = "http://gdata.youtube.com/schemas/2007/keywords.cat";
term = the;
},
{
scheme = "http://gdata.youtube.com/schemas/2007/keywords.cat";
term = Sith;
}
);
content = {
"$t" = "sw-destiny.net Trailer for Revenge of the Sith";
type = text;
};
"gd$comments" = {
"gd$feedLink" = {
countHint = 1567;
href = "https://gdata.youtube.com/feeds/api/videos/9kdEsZH5ohc/comments";
rel = "http://gdata.youtube.com/schemas/2007#comments";
};
};
"gd$rating" = {
average = "4.7729683";
max = 5;
min = 1;
numRaters = 1132;
rel = "http://schemas.google.com/g/2005#overall";
};
id = {
"$t" = "http://gdata.youtube.com/feeds/api/videos/9kdEsZH5ohc";
};
link = (
{
href = "https://www.youtube.com/watch?v=9kdEsZH5ohc&feature=youtube_gdata";
rel = alternate;
type = "text/html";
},
{
href = "https://gdata.youtube.com/feeds/api/videos/9kdEsZH5ohc/responses";
rel = "http://gdata.youtube.com/schemas/2007#video.responses";
type = "application/atom+xml";
},
{
href = "https://gdata.youtube.com/feeds/api/videos/9kdEsZH5ohc/related";
rel = "http://gdata.youtube.com/schemas/2007#video.related";
type = "application/atom+xml";
},
{
href = "https://m.youtube.com/details?v=9kdEsZH5ohc";
rel = "http://gdata.youtube.com/schemas/2007#mobile";
type = "text/html";
},
{
href = "https://gdata.youtube.com/feeds/api/videos/9kdEsZH5ohc";
rel = self;
type = "application/atom+xml";
}
);
"media$group" = {
"media$category" = (
{
"$t" = Entertainment;
label = Entertainment;
scheme = "http://gdata.youtube.com/schemas/2007/categories.cat";
}
);
"media$content" = (
{
duration = 151;
expression = full;
isDefault = true;
medium = video;
type = "application/x-shockwave-flash";
url = "https://www.youtube.com/v/9kdEsZH5ohc?version=3&f=videos&app=youtube_gdata";
"yt$format" = 5;
},
{
duration = 151;
expression = full;
medium = video;
type = "video/3gpp";
url = "rtsp://v2.cache4.c.youtube.com/CiILENy73wIaGQkXovmRsURH9hMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp";
"yt$format" = 1;
},
{
duration = 151;
expression = full;
medium = video;
type = "video/3gpp";
url = "rtsp://v2.cache5.c.youtube.com/CiILENy73wIaGQkXovmRsURH9hMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp";
"yt$format" = 6;
}
);
"media$description" = {
"$t" = "sw-destiny.net Trailer for Revenge of the Sith";
type = plain;
};
"media$keywords" = {
"$t" = "Star, Wars, Episode, 3, Revenge, of, the, Sith";
};
"media$player" = (
{
url = "https://www.youtube.com/watch?v=9kdEsZH5ohc&feature=youtube_gdata_player";
}
);
"media$thumbnail" = (
{
height = 360;
time = "00:01:15.500";
url = "http://i.ytimg.com/vi/9kdEsZH5ohc/0.jpg";
width = 480;
},
{
height = 90;
time = "00:00:37.750";
url = "http://i.ytimg.com/vi/9kdEsZH5ohc/1.jpg";
width = 120;
},
{
height = 90;
time = "00:01:15.500";
url = "http://i.ytimg.com/vi/9kdEsZH5ohc/2.jpg";
width = 120;
},
{
height = 90;
time = "00:01:53.250";
url = "http://i.ytimg.com/vi/9kdEsZH5ohc/3.jpg";
width = 120;
}
);
"media$title" = {
"$t" = "Star Wars Episode 3 Revenge of the Sith Trailer";
type = plain;
};
"yt$duration" = {
seconds = 151;
};
};
published = {
"$t" = "2007-05-23T03:31:54.000Z";
};
title = {
"$t" = "Star Wars Episode 3 Revenge of the Sith Trailer";
type = text;
};
updated = {
"$t" = "2012-02-20T17:14:37.000Z";
};
"yt$statistics" = {
favoriteCount = 763;
viewCount = 796719;
};
}
);
xmlns = "http://www.w3.org/2005/Atom";
"xmlns$gd" = "http://schemas.google.com/g/2005";
"xmlns$media" = "http://search.yahoo.com/mrss/";
"xmlns$yt" = "http://gdata.youtube.com/schemas/2007";
};
version = "1.0";
}