<commit_before>﻿#region

using System;
using System.Collections.Generic;
using System.Linq;
using Windows.Graphics.Display;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Audiotica.Core.Utilities;
using Audiotica.Data.Collection;
using Audiotica.Data.Collection.Model;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;

#endregion

namespace Audiotica.ViewModel
{
    public class CollectionViewModel : ViewModelBase
    {
        private readonly ICollectionService _service;
#if WINDOWS_PHONE_APP
        private readonly AudioPlayerHelper _audioPlayer;
#endif
        private readonly RelayCommand<ItemClickEventArgs> _songClickCommand;

        public CollectionViewModel(ICollectionService service
#if WINDOWS_PHONE_APP
, AudioPlayerHelper audioPlayer
#endif
            )
        {
            _service = service;
#if WINDOWS_PHONE_APP
            _audioPlayer = audioPlayer;
#endif

            _songClickCommand = new RelayCommand<ItemClickEventArgs>(SongClickExecute);

            if (IsInDesignModeStatic)
                _service.LoadLibrary();
        }

        private async void SongClickExecute(ItemClickEventArgs e)
        {
            var song = e.ClickedItem as Song;

            await _service.ClearQueueAsync();

            foreach (var queueSong in _service.Songs)
            {
                await _service.AddToQueueAsync(queueSong);
            }

#if WINDOWS_PHONE_APP
            //play the song here
            _audioPlayer.PlaySong(song.Id);
#endif
        }

        private int rowCount
        {
            get
            {
                //extra collumn if running on hd device (720, 768 and 1080)
                var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
                var actualWidth = (int)(Window.Current.Bounds.Width * scaleFactor);
                return actualWidth >= 720 ? 5 : 4;
            }
        }

        public List<Album> RandomizeAlbumList
        {
            get
            {
                var albums = Service.Albums.Where(p => p.Artwork != CollectionConstant.MissingArtworkImage).ToList();<commit_msg>Five column of artwork for HD only<commit_after>﻿#region

using System;
using System.Collections.Generic;
using System.Linq;
using Windows.Graphics.Display;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Audiotica.Core.Utilities;
using Audiotica.Data.Collection;
using Audiotica.Data.Collection.Model;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;

#endregion

namespace Audiotica.ViewModel
{
    public class CollectionViewModel : ViewModelBase
    {
        private readonly ICollectionService _service;
#if WINDOWS_PHONE_APP
        private readonly AudioPlayerHelper _audioPlayer;
#endif
        private readonly RelayCommand<ItemClickEventArgs> _songClickCommand;

        public CollectionViewModel(ICollectionService service
#if WINDOWS_PHONE_APP
, AudioPlayerHelper audioPlayer
#endif
            )
        {
            _service = service;
#if WINDOWS_PHONE_APP
            _audioPlayer = audioPlayer;
#endif

            _songClickCommand = new RelayCommand<ItemClickEventArgs>(SongClickExecute);

            if (IsInDesignModeStatic)
                _service.LoadLibrary();
        }

        private async void SongClickExecute(ItemClickEventArgs e)
        {
            var song = e.ClickedItem as Song;

            await _service.ClearQueueAsync();

            foreach (var queueSong in _service.Songs)
            {
                await _service.AddToQueueAsync(queueSong);
            }

#if WINDOWS_PHONE_APP
            //play the song here
            _audioPlayer.PlaySong(song.Id);
#endif
        }

        private int rowCount
        {
            get
            {
                //extra column if running on hd device (720 and 1080)
                var scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
                var actualWidth = (int)(Window.Current.Bounds.Width * scaleFactor);
                return actualWidth == 720 || actualWidth == 1080 ? 5 : 4;
            }
        }

        public List<Album> RandomizeAlbumList
        {
            get
            {
                var albums = Service.Albums.Where(p => p.Artwork != CollectionConstant.MissingArtworkImage).ToList();
{'fraction_non_alphanumeric': 0.07162346521145975, 'fraction_numerical': 0.007048658481127785, 'mean_word_length': 2.3376327769347496, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4436902', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1158, 'n_words': 268}