Esempio n. 1
0
        public string[] GetTopTags(string categoryName)
        {
            return(queries.HandleQuery(ctx => {
                var tags = ctx.Query()
                           .Where(t => categoryName == null || t.CategoryName == categoryName)
                           .OrderByDescending(t => t.AllAlbumTagUsages.Count + t.AllArtistTagUsages.Count + t.AllSongTagUsages.Count)
                           .Select(t => t.Name)
                           .Take(15)
                           .ToArray()
                           .OrderBy(t => t)
                           .ToArray();

                return tags;
            }));
        }
Esempio n. 2
0
        //
        // GET: /Help/

        public ActionResult Index()
        {
            if (!string.IsNullOrEmpty(AppConfig.ExternalHelpPath))
            {
                return(View("External"));
            }

            ViewBag.FreeTagId         = config.SpecialTags.Free;
            ViewBag.InstrumentalTagId = tagQueries.HandleQuery(ctx => new EntryTypeTags(ctx).Instrumental);

            switch (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName)
            {
            case "ja":
                return(View("Index.ja"));

            case "zh":
                return(View("Index.zh-Hans"));

            default:
                return(View());
            }
        }
Esempio n. 3
0
 public TagForApiContract[] GetChildTags(int tagId,
                                         TagOptionalFields fields       = TagOptionalFields.None,
                                         ContentLanguagePreference lang = ContentLanguagePreference.Default)
 {
     return(queries.HandleQuery(ctx => ctx.Load(tagId).Children.Select(t => new TagForApiContract(t, thumbPersister, lang, fields)).ToArray()));
 }
Esempio n. 4
0
 public string[] GetCategoryNamesList()
 {
     return(queries.HandleQuery(ctx => ctx.Query().Where(t => t.CategoryName != null && t.CategoryName != "").Select(t => t.CategoryName).Distinct().ToArray()));
 }