2012-09-07 18:17:39 +02:00
|
|
|
|
using MediaBrowser.Controller;
|
|
|
|
|
using MediaBrowser.Model.DTO;
|
|
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
|
using System;
|
2012-08-19 22:38:31 +02:00
|
|
|
|
using System.Collections.Generic;
|
2012-07-20 04:22:44 +02:00
|
|
|
|
using System.Linq;
|
2012-08-19 22:38:31 +02:00
|
|
|
|
using System.Threading.Tasks;
|
2012-07-13 05:50:50 +02:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Api
|
|
|
|
|
{
|
2012-07-20 04:22:44 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Contains some helpers for the api
|
|
|
|
|
/// </summary>
|
2012-07-13 05:50:50 +02:00
|
|
|
|
public static class ApiService
|
|
|
|
|
{
|
2012-09-07 18:17:39 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets an Item by Id, or the root item if none is supplied
|
|
|
|
|
/// </summary>
|
2012-07-13 05:50:50 +02:00
|
|
|
|
public static BaseItem GetItemById(string id)
|
|
|
|
|
{
|
2012-07-16 18:50:44 +02:00
|
|
|
|
Guid guid = string.IsNullOrEmpty(id) ? Guid.Empty : new Guid(id);
|
2012-07-13 05:50:50 +02:00
|
|
|
|
|
2012-07-16 18:50:44 +02:00
|
|
|
|
return Kernel.Instance.GetItemById(guid);
|
2012-07-13 05:50:50 +02:00
|
|
|
|
}
|
|
|
|
|
|
2012-09-07 18:17:39 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a User by Id
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="logActivity">Whether or not to update the user's LastActivityDate</param>
|
|
|
|
|
public static User GetUserById(string id, bool logActivity)
|
|
|
|
|
{
|
|
|
|
|
Guid guid = new Guid(id);
|
|
|
|
|
|
|
|
|
|
User user = Kernel.Instance.Users.FirstOrDefault(u => u.Id == guid);
|
|
|
|
|
|
|
|
|
|
if (logActivity)
|
|
|
|
|
{
|
|
|
|
|
LogUserActivity(user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the default User
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="logActivity">Whether or not to update the user's LastActivityDate</param>
|
|
|
|
|
public static User GetDefaultUser(bool logActivity)
|
|
|
|
|
{
|
|
|
|
|
User user = Kernel.Instance.GetDefaultUser();
|
|
|
|
|
|
|
|
|
|
if (logActivity)
|
|
|
|
|
{
|
|
|
|
|
LogUserActivity(user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Updates LastActivityDate for a given User
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static void LogUserActivity(User user)
|
|
|
|
|
{
|
|
|
|
|
user.LastActivityDate = DateTime.UtcNow;
|
|
|
|
|
Kernel.Instance.SaveUser(user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Converts a BaseItem to a DTOBaseItem
|
|
|
|
|
/// </summary>
|
2012-08-20 14:09:42 +02:00
|
|
|
|
public async static Task<DTOBaseItem> GetDTOBaseItem(BaseItem item, User user,
|
|
|
|
|
bool includeChildren = true,
|
2012-08-18 10:22:54 +02:00
|
|
|
|
bool includePeople = true)
|
2012-07-13 05:50:50 +02:00
|
|
|
|
{
|
2012-08-18 10:22:54 +02:00
|
|
|
|
DTOBaseItem dto = new DTOBaseItem();
|
|
|
|
|
|
2012-08-22 19:01:24 +02:00
|
|
|
|
List<Task> tasks = new List<Task>();
|
|
|
|
|
|
|
|
|
|
tasks.Add(AttachStudios(dto, item));
|
|
|
|
|
|
|
|
|
|
if (includeChildren)
|
|
|
|
|
{
|
|
|
|
|
tasks.Add(AttachChildren(dto, item, user));
|
|
|
|
|
tasks.Add(AttachLocalTrailers(dto, item, user));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (includePeople)
|
|
|
|
|
{
|
|
|
|
|
tasks.Add(AttachPeople(dto, item));
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-02 23:55:47 +02:00
|
|
|
|
AttachBasicFields(dto, item, user);
|
|
|
|
|
|
2012-08-22 19:01:24 +02:00
|
|
|
|
// Make sure all the tasks we kicked off have completed.
|
|
|
|
|
if (tasks.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
await Task.WhenAll(tasks).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return dto;
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-07 18:17:39 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets simple property values on a DTOBaseItem
|
|
|
|
|
/// </summary>
|
2012-08-22 19:01:24 +02:00
|
|
|
|
private static void AttachBasicFields(DTOBaseItem dto, BaseItem item, User user)
|
|
|
|
|
{
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.AspectRatio = item.AspectRatio;
|
|
|
|
|
dto.BackdropCount = item.BackdropImagePaths == null ? 0 : item.BackdropImagePaths.Count();
|
|
|
|
|
dto.DateCreated = item.DateCreated;
|
|
|
|
|
dto.DisplayMediaType = item.DisplayMediaType;
|
2012-08-29 21:37:05 +02:00
|
|
|
|
|
|
|
|
|
if (item.Genres != null)
|
|
|
|
|
{
|
|
|
|
|
dto.Genres = item.Genres.ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.HasArt = !string.IsNullOrEmpty(item.ArtImagePath);
|
|
|
|
|
dto.HasBanner = !string.IsNullOrEmpty(item.BannerImagePath);
|
|
|
|
|
dto.HasLogo = !string.IsNullOrEmpty(item.LogoImagePath);
|
2012-09-02 23:55:47 +02:00
|
|
|
|
dto.HasPrimaryImage = !string.IsNullOrEmpty(item.PrimaryImagePath);
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.HasThumb = !string.IsNullOrEmpty(item.ThumbnailImagePath);
|
|
|
|
|
dto.Id = item.Id;
|
2012-08-19 19:02:26 +02:00
|
|
|
|
dto.IsNew = item.IsRecentlyAdded(user);
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.IndexNumber = item.IndexNumber;
|
2012-08-20 02:13:51 +02:00
|
|
|
|
dto.IsFolder = item.IsFolder;
|
2012-08-20 04:05:55 +02:00
|
|
|
|
dto.Language = item.Language;
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.LocalTrailerCount = item.LocalTrailers == null ? 0 : item.LocalTrailers.Count();
|
|
|
|
|
dto.Name = item.Name;
|
|
|
|
|
dto.OfficialRating = item.OfficialRating;
|
|
|
|
|
dto.Overview = item.Overview;
|
|
|
|
|
|
|
|
|
|
// If there are no backdrops, indicate what parent has them in case the UI wants to allow inheritance
|
|
|
|
|
if (dto.BackdropCount == 0)
|
2012-08-03 17:54:05 +02:00
|
|
|
|
{
|
|
|
|
|
int backdropCount;
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.ParentBackdropItemId = GetParentBackdropItemId(item, out backdropCount);
|
|
|
|
|
dto.ParentBackdropCount = backdropCount;
|
2012-08-03 17:54:05 +02:00
|
|
|
|
}
|
|
|
|
|
|
2012-08-01 19:20:22 +02:00
|
|
|
|
if (item.Parent != null)
|
|
|
|
|
{
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.ParentId = item.Parent.Id;
|
2012-08-01 19:20:22 +02:00
|
|
|
|
}
|
|
|
|
|
|
2012-08-20 04:05:55 +02:00
|
|
|
|
dto.ParentIndexNumber = item.ParentIndexNumber;
|
|
|
|
|
|
2012-08-18 10:22:54 +02:00
|
|
|
|
// If there is no logo, indicate what parent has one in case the UI wants to allow inheritance
|
|
|
|
|
if (!dto.HasLogo)
|
2012-07-16 18:50:44 +02:00
|
|
|
|
{
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.ParentLogoItemId = GetParentLogoItemId(item);
|
|
|
|
|
}
|
2012-07-13 05:50:50 +02:00
|
|
|
|
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.Path = item.Path;
|
2012-08-15 15:20:29 +02:00
|
|
|
|
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.PremiereDate = item.PremiereDate;
|
|
|
|
|
dto.ProductionYear = item.ProductionYear;
|
|
|
|
|
dto.ProviderIds = item.ProviderIds;
|
|
|
|
|
dto.RunTimeTicks = item.RunTimeTicks;
|
|
|
|
|
dto.SortName = item.SortName;
|
2012-08-29 21:37:05 +02:00
|
|
|
|
|
|
|
|
|
if (item.Taglines != null)
|
|
|
|
|
{
|
|
|
|
|
dto.Taglines = item.Taglines.ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.TrailerUrl = item.TrailerUrl;
|
|
|
|
|
dto.Type = item.GetType().Name;
|
|
|
|
|
dto.UserRating = item.UserRating;
|
2012-08-17 18:47:35 +02:00
|
|
|
|
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.UserData = item.GetUserData(user);
|
2012-08-17 18:47:35 +02:00
|
|
|
|
|
2012-08-18 10:22:54 +02:00
|
|
|
|
Folder folder = item as Folder;
|
|
|
|
|
|
|
|
|
|
if (folder != null)
|
|
|
|
|
{
|
|
|
|
|
dto.SpecialCounts = folder.GetSpecialCounts(user);
|
2012-08-18 18:45:11 +02:00
|
|
|
|
|
|
|
|
|
dto.IsRoot = folder.IsRoot;
|
2012-08-28 18:36:31 +02:00
|
|
|
|
dto.IsVirtualFolder = folder.IsVirtualFolder;
|
2012-08-18 10:22:54 +02:00
|
|
|
|
}
|
2012-08-20 14:09:42 +02:00
|
|
|
|
|
|
|
|
|
Audio audio = item as Audio;
|
|
|
|
|
|
|
|
|
|
if (audio != null)
|
|
|
|
|
{
|
|
|
|
|
dto.AudioInfo = new AudioInfo()
|
|
|
|
|
{
|
|
|
|
|
Album = audio.Album,
|
|
|
|
|
AlbumArtist = audio.AlbumArtist,
|
|
|
|
|
Artist = audio.Artist,
|
|
|
|
|
BitRate = audio.BitRate,
|
2012-08-20 14:20:51 +02:00
|
|
|
|
Channels = audio.Channels
|
2012-08-20 14:09:42 +02:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-22 14:56:44 +02:00
|
|
|
|
Video video = item as Video;
|
|
|
|
|
|
|
|
|
|
if (video != null)
|
|
|
|
|
{
|
|
|
|
|
dto.VideoInfo = new VideoInfo()
|
|
|
|
|
{
|
|
|
|
|
Height = video.Height,
|
|
|
|
|
Width = video.Width,
|
|
|
|
|
Codec = video.Codec,
|
|
|
|
|
VideoType = video.VideoType,
|
|
|
|
|
ScanType = video.ScanType
|
|
|
|
|
};
|
2012-08-29 21:37:05 +02:00
|
|
|
|
|
|
|
|
|
if (video.AudioStreams != null)
|
|
|
|
|
{
|
|
|
|
|
dto.VideoInfo.AudioStreams = video.AudioStreams.ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (video.Subtitles != null)
|
|
|
|
|
{
|
|
|
|
|
dto.VideoInfo.Subtitles = video.Subtitles.ToArray();
|
|
|
|
|
}
|
2012-08-22 14:56:44 +02:00
|
|
|
|
}
|
2012-08-18 10:22:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
2012-09-07 18:17:39 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Attaches Studio DTO's to a DTOBaseItem
|
|
|
|
|
/// </summary>
|
2012-08-19 22:38:31 +02:00
|
|
|
|
private static async Task AttachStudios(DTOBaseItem dto, BaseItem item)
|
2012-08-18 10:22:54 +02:00
|
|
|
|
{
|
2012-08-17 18:47:35 +02:00
|
|
|
|
// Attach Studios by transforming them into BaseItemStudio (DTO)
|
|
|
|
|
if (item.Studios != null)
|
|
|
|
|
{
|
2012-08-29 21:37:05 +02:00
|
|
|
|
Studio[] entities = await Task.WhenAll<Studio>(item.Studios.Select(c => Kernel.Instance.ItemController.GetStudio(c))).ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
dto.Studios = new BaseItemStudio[entities.Length];
|
2012-08-20 14:09:42 +02:00
|
|
|
|
|
2012-08-29 21:37:05 +02:00
|
|
|
|
for (int i = 0; i < entities.Length; i++)
|
2012-08-17 18:47:35 +02:00
|
|
|
|
{
|
2012-08-29 21:37:05 +02:00
|
|
|
|
Studio entity = entities[i];
|
2012-08-17 18:47:35 +02:00
|
|
|
|
BaseItemStudio baseItemStudio = new BaseItemStudio();
|
|
|
|
|
|
2012-08-29 21:37:05 +02:00
|
|
|
|
baseItemStudio.Name = entity.Name;
|
2012-08-17 18:47:35 +02:00
|
|
|
|
|
2012-08-29 21:37:05 +02:00
|
|
|
|
baseItemStudio.HasImage = !string.IsNullOrEmpty(entity.PrimaryImagePath);
|
2012-08-17 18:47:35 +02:00
|
|
|
|
|
2012-08-29 21:37:05 +02:00
|
|
|
|
dto.Studios[i] = baseItemStudio;
|
|
|
|
|
}
|
2012-07-16 18:50:44 +02:00
|
|
|
|
}
|
2012-08-18 10:22:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
2012-09-07 18:17:39 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Attaches child DTO's to a DTOBaseItem
|
|
|
|
|
/// </summary>
|
2012-08-19 22:38:31 +02:00
|
|
|
|
private static async Task AttachChildren(DTOBaseItem dto, BaseItem item, User user)
|
2012-08-18 10:22:54 +02:00
|
|
|
|
{
|
|
|
|
|
var folder = item as Folder;
|
2012-07-16 18:50:44 +02:00
|
|
|
|
|
2012-08-18 10:22:54 +02:00
|
|
|
|
if (folder != null)
|
|
|
|
|
{
|
2012-08-19 22:38:31 +02:00
|
|
|
|
IEnumerable<BaseItem> children = folder.GetParentalAllowedChildren(user);
|
|
|
|
|
|
2012-08-22 04:50:59 +02:00
|
|
|
|
dto.Children = await Task.WhenAll<DTOBaseItem>(children.Select(c => GetDTOBaseItem(c, user, false, false))).ConfigureAwait(false);
|
2012-08-18 10:22:54 +02:00
|
|
|
|
}
|
2012-08-22 19:01:24 +02:00
|
|
|
|
}
|
2012-08-18 10:22:54 +02:00
|
|
|
|
|
2012-09-07 18:17:39 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Attaches trailer DTO's to a DTOBaseItem
|
|
|
|
|
/// </summary>
|
2012-08-22 19:01:24 +02:00
|
|
|
|
private static async Task AttachLocalTrailers(DTOBaseItem dto, BaseItem item, User user)
|
|
|
|
|
{
|
2012-08-20 02:13:51 +02:00
|
|
|
|
if (item.LocalTrailers != null && item.LocalTrailers.Any())
|
|
|
|
|
{
|
2012-08-22 04:50:59 +02:00
|
|
|
|
dto.LocalTrailers = await Task.WhenAll<DTOBaseItem>(item.LocalTrailers.Select(c => GetDTOBaseItem(c, user, false, false))).ConfigureAwait(false);
|
2012-08-20 02:13:51 +02:00
|
|
|
|
}
|
2012-08-18 10:22:54 +02:00
|
|
|
|
}
|
2012-08-23 14:50:41 +02:00
|
|
|
|
|
2012-09-07 18:17:39 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Attaches People DTO's to a DTOBaseItem
|
|
|
|
|
/// </summary>
|
2012-08-19 22:38:31 +02:00
|
|
|
|
private static async Task AttachPeople(DTOBaseItem dto, BaseItem item)
|
2012-08-18 10:22:54 +02:00
|
|
|
|
{
|
|
|
|
|
// Attach People by transforming them into BaseItemPerson (DTO)
|
|
|
|
|
if (item.People != null)
|
|
|
|
|
{
|
2012-08-24 18:24:29 +02:00
|
|
|
|
IEnumerable<Person> entities = await Task.WhenAll<Person>(item.People.Select(c => Kernel.Instance.ItemController.GetPerson(c.Key))).ConfigureAwait(false);
|
2012-08-19 22:38:31 +02:00
|
|
|
|
|
2012-08-18 10:22:54 +02:00
|
|
|
|
dto.People = item.People.Select(p =>
|
|
|
|
|
{
|
|
|
|
|
BaseItemPerson baseItemPerson = new BaseItemPerson();
|
|
|
|
|
|
2012-08-24 18:24:29 +02:00
|
|
|
|
baseItemPerson.Name = p.Key;
|
|
|
|
|
baseItemPerson.Overview = p.Value.Overview;
|
|
|
|
|
baseItemPerson.Type = p.Value.Type;
|
2012-08-18 10:22:54 +02:00
|
|
|
|
|
2012-08-24 18:24:29 +02:00
|
|
|
|
Person ibnObject = entities.First(i => i.Name.Equals(p.Key, StringComparison.OrdinalIgnoreCase));
|
2012-08-18 10:22:54 +02:00
|
|
|
|
|
|
|
|
|
if (ibnObject != null)
|
|
|
|
|
{
|
|
|
|
|
baseItemPerson.HasImage = !string.IsNullOrEmpty(ibnObject.PrimaryImagePath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return baseItemPerson;
|
2012-08-29 14:21:56 +02:00
|
|
|
|
}).ToArray();
|
2012-08-18 10:22:54 +02:00
|
|
|
|
}
|
2012-07-13 05:50:50 +02:00
|
|
|
|
}
|
2012-08-01 19:20:22 +02:00
|
|
|
|
|
2012-09-07 18:17:39 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// If an item does not any backdrops, this can be used to find the first parent that does have one
|
|
|
|
|
/// </summary>
|
2012-08-03 17:54:05 +02:00
|
|
|
|
private static Guid? GetParentBackdropItemId(BaseItem item, out int backdropCount)
|
2012-08-01 19:20:22 +02:00
|
|
|
|
{
|
2012-08-03 17:54:05 +02:00
|
|
|
|
backdropCount = 0;
|
|
|
|
|
|
|
|
|
|
var parent = item.Parent;
|
2012-08-01 19:20:22 +02:00
|
|
|
|
|
2012-08-03 17:54:05 +02:00
|
|
|
|
while (parent != null)
|
|
|
|
|
{
|
|
|
|
|
if (parent.BackdropImagePaths != null && parent.BackdropImagePaths.Any())
|
2012-08-01 19:20:22 +02:00
|
|
|
|
{
|
2012-08-03 17:54:05 +02:00
|
|
|
|
backdropCount = parent.BackdropImagePaths.Count();
|
|
|
|
|
return parent.Id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
parent = parent.Parent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2012-08-01 19:20:22 +02:00
|
|
|
|
|
2012-09-07 18:17:39 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// If an item does not have a logo, this can be used to find the first parent that does have one
|
|
|
|
|
/// </summary>
|
2012-08-03 17:54:05 +02:00
|
|
|
|
private static Guid? GetParentLogoItemId(BaseItem item)
|
|
|
|
|
{
|
|
|
|
|
var parent = item.Parent;
|
|
|
|
|
|
|
|
|
|
while (parent != null)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(parent.LogoImagePath))
|
|
|
|
|
{
|
|
|
|
|
return parent.Id;
|
2012-08-01 19:20:22 +02:00
|
|
|
|
}
|
2012-08-03 17:54:05 +02:00
|
|
|
|
|
|
|
|
|
parent = parent.Parent;
|
2012-08-01 19:20:22 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2012-08-23 14:50:41 +02:00
|
|
|
|
|
2012-09-07 18:17:39 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets an ImagesByName entity along with the number of items containing it
|
|
|
|
|
/// </summary>
|
2012-08-23 14:50:41 +02:00
|
|
|
|
public static IBNItem GetIBNItem(BaseEntity entity, int itemCount)
|
|
|
|
|
{
|
|
|
|
|
return new IBNItem()
|
|
|
|
|
{
|
|
|
|
|
Id = entity.Id,
|
|
|
|
|
BaseItemCount = itemCount,
|
2012-08-23 14:59:40 +02:00
|
|
|
|
HasImage = !string.IsNullOrEmpty(entity.PrimaryImagePath),
|
2012-08-23 14:50:41 +02:00
|
|
|
|
Name = entity.Name
|
|
|
|
|
};
|
|
|
|
|
}
|
2012-08-29 14:21:56 +02:00
|
|
|
|
|
2012-09-07 18:17:39 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Converts a User to a DTOUser
|
|
|
|
|
/// </summary>
|
2012-08-29 14:21:56 +02:00
|
|
|
|
public static DTOUser GetDTOUser(User user)
|
|
|
|
|
{
|
|
|
|
|
return new DTOUser()
|
|
|
|
|
{
|
|
|
|
|
Id = user.Id,
|
|
|
|
|
Name = user.Name,
|
2012-09-06 20:38:29 +02:00
|
|
|
|
HasImage = !string.IsNullOrEmpty(user.PrimaryImagePath),
|
2012-09-06 22:29:33 +02:00
|
|
|
|
HasPassword = !string.IsNullOrEmpty(user.Password),
|
|
|
|
|
LastActivityDate = user.LastActivityDate,
|
|
|
|
|
LastLoginDate = user.LastLoginDate
|
2012-08-29 14:21:56 +02:00
|
|
|
|
};
|
|
|
|
|
}
|
2012-07-13 05:50:50 +02:00
|
|
|
|
}
|
|
|
|
|
}
|