/// <summary>
        /// Create a new job for the queue.
        /// </summary>
        /// <param name="userId">ASP.NET Identity User Id</param>
        /// <param name="activityId">Optional Strava activity id</param>
        /// <returns></returns>
        public static DownloadQueue CreateQueueJob(string userId, DownloadType type, long?activityId, int?duration)
        {
            DownloadQueue q = new DownloadQueue();

            q.UserId       = userId;
            q.DownloadType = type;
            q.ActivityId   = activityId;

            q.Added       = DateTime.Now;
            q.Processed   = false;
            q.ProcessedAt = null;
            q.HasError    = false;
            q.Duration    = duration;
            return(q);
        }
 public static DownloadQueue CreateQueueJob(string userId, DownloadType type)
 {
     return(DownloadQueue.CreateQueueJob(userId, type, null));
 }
 internal static DownloadQueue CreateQueueJob(DownloadQueue job)
 {
     return(CreateQueueJob(job.UserId, job.DownloadType, job.ActivityId, job.Duration));
 }