Esempio n. 1
0
    public void SpawnEnemy(Vector3 position, DiscType lootedDiscType)
    {
        if (spawned)
        {
            return;
        }

        spawned = true;

        damageReceiptionSystem.SetUpSystem(false);
        transform.position = position;
        gameObject.SetActive(true);
        SetUpInitiative();
        _lootedDiscType = lootedDiscType;

        if (_lootedDiscType != DiscType.None)
        {
            Debug.Log(name + " will loot " + _lootedDiscType + " disc");
        }

        if (lootDiscIndicator != null)
        {
            lootDiscIndicator.SetActive(_lootedDiscType != DiscType.None);
        }

        InitLifeBar(damageReceiptionSystem.GetCurrentLifeAmount);
        tooltipCollider.SetValueInInfos(damageReceiptionSystem.GetCurrentLifeAmount);
        enemyAnimator.SetBool("Dead", false);
    }
Esempio n. 2
0
        public ActionResult Index(string filter, EntryType searchType = EntryType.Undefined, bool allowRedirect = true,
            string tag = null,
            string sort = null,
            int? artistId = null,
            ArtistType? artistType = null,
            DiscType? discType = null,
            SongType? songType = null,
            bool? onlyWithPVs = null
            )
        {
            filter = !string.IsNullOrEmpty(filter) ? filter.Trim() : string.Empty;

            if (allowRedirect && !string.IsNullOrEmpty(filter)) {

                var redirectResult = TryRedirect(filter, searchType);

                if (redirectResult != null)
                    return redirectResult;

            }

            ViewBag.Query = filter;
            ViewBag.SearchType = searchType != EntryType.Undefined ? searchType.ToString() : "Anything";
            ViewBag.Tag = tag;
            ViewBag.Sort = sort;
            ViewBag.ArtistId = artistId;
            ViewBag.ArtistType = artistType;
            ViewBag.DiscType = discType;
            ViewBag.SongType = songType;
            ViewBag.OnlyWithPVs = onlyWithPVs;

            SetSearchEntryType(searchType);
            return View();
        }
Esempio n. 3
0
        public static Disc Create(this DiscType type, string path, Action <string> errorCallback)
        {
            //--- load the disc in a context which will let us abort if it's going to take too long
            var discMountJob = new DiscMountJob {
                IN_FromPath = path, IN_SlowLoadAbortThreshold = 8
            };

            discMountJob.Run();
            var disc = discMountJob.OUT_Disc ?? throw new InvalidOperationException($"Can't find the file specified: {path}");

            if (discMountJob.OUT_SlowLoadAborted)
            {
                errorCallback("This disc would take too long to load. Run it through DiscoHawk first, or find a new rip because this one is probably junk");
                return(null);
            }

            if (discMountJob.OUT_ErrorLevel)
            {
                throw new InvalidOperationException($"\r\n{discMountJob.OUT_Log}");
            }

            var discType = new DiscIdentifier(disc).DetectDiscType();

            if (discType != type)
            {
                errorCallback($"Not a {type} disc");
                return(null);
            }

            return(disc);
        }
Esempio n. 4
0
    public void DiscOverload(DiscType overloadType)
    {
        switch (overloadType)
        {
        case DiscType.Piercing:
            PlayerExperienceManager.Instance.GainGold(discOverloadPiercingGainedExperience);
            break;

        case DiscType.Ghost:
            GameManager.Instance.GainActionPoints(discOverloadGhostGainedActionPoints);
            break;

        case DiscType.Explosive:
            EffectZone explosiveEffectZone = EffectZonesManager.Instance.GetEffectZoneFromPool(discOverloadExplosiveEffectZoneType);
            if (explosiveEffectZone != null)
            {
                explosiveEffectZone.StartZone(player.transform.position);
            }
            break;

        case DiscType.Heavy:
            GameManager.Instance.GetPlayer.damageReceiptionSystem.RegainLife(discOverloadHeavyGainedHP);
            break;

        case DiscType.Shockwave:
            EffectZone shockwaveEffectZone = EffectZonesManager.Instance.GetEffectZoneFromPool(discOverloadShockwaveEffectZoneType);
            if (shockwaveEffectZone != null)
            {
                shockwaveEffectZone.StartZone(player.transform.position);
            }
            break;
        }
    }
Esempio n. 5
0
        public IActionResult DiscTypeAdd(DiscType discType)
        {
            _context.Add(discType);
            _context.SaveChanges();

            return(RedirectToAction("DiscType"));
        }
        public static ShapesMaterials GetDiscMaterial(DiscType type)
        {
            ShapesMaterials Load()
            {
                switch (type)
                {
                case DiscType.Disc: return(matDisc);

                case DiscType.Pie:  return(matCircleSector);

                case DiscType.Ring: return(matRing);

                case DiscType.Arc:  return(matRingSector);

                default:            throw new IndexOutOfRangeException($"Failed to get disc material, invalid enum index of {(int)type} ");
                }
            }

            ShapesMaterials mat = Load();

                        #if UNITY_EDITOR
            if (mat == null)              // editor only to save perf in builds
            {
                throw new NullReferenceException($"Loaded disc material {type} is null");
            }
                        #endif

            return(mat);
        }
Esempio n. 7
0
    public DiscScript GetDiscFromPool(DiscType discType)
    {
        if (allDiscPools.ContainsKey(discType))
        {
            DiscScript newDisc = null;

            if (allDiscPools[discType].Count > 0)
            {
                newDisc = allDiscPools[discType].Dequeue();
                newDisc.gameObject.SetActive(true);
            }
            else
            {
                newDisc = Instantiate(discTypeToPrefab[discType], discTypeToPoolParent[discType]);
                newDisc.SetUpModifiers();
                newDisc.SetDiscType(discType);
                newDisc.gameObject.SetActive(true);
            }

            inGameDiscs.Add(newDisc);

            return(newDisc);
        }

        return(null);
    }
Esempio n. 8
0
        public PartialFindResult <AlbumContract> Find(
            SearchTextQuery textQuery, DiscType discType, int start, int maxResults, bool getTotalCount,
            AlbumSortRule sortRule = AlbumSortRule.Name, bool moveExactToTop = false)
        {
            var queryParams = new AlbumQueryParams(textQuery, discType, start, maxResults, getTotalCount, sortRule, moveExactToTop);

            return(Find(queryParams));
        }
Esempio n. 9
0
        public PartialFindResult <AlbumContract> Find(
            string query, DiscType discType, int start, int maxResults, bool draftsOnly, bool getTotalCount,
            NameMatchMode nameMatchMode = NameMatchMode.Auto, AlbumSortRule sortRule = AlbumSortRule.Name, bool moveExactToTop = false)
        {
            var queryParams = new AlbumQueryParams(query, discType, start, maxResults, draftsOnly, getTotalCount, nameMatchMode, sortRule, moveExactToTop);

            return(Find(queryParams));
        }
Esempio n. 10
0
 void DrawAngleProperties(DiscType selectedType)
 {
     using (new EditorGUI.DisabledScope(selectedType.HasSector() == false && serializedObject.isEditingMultipleObjects == false)) {
         ShapesUI.AngleProperty(propAngRadiansStart, "Angle start", propAngUnitInput, angLabelLayout);
         ShapesUI.AngleProperty(propAngRadiansEnd, "Angle end", propAngUnitInput, angLabelLayout);
         ShapesUI.DrawAngleSwitchButtons(propAngUnitInput);
     }
 }
Esempio n. 11
0
        public AlbumQueryParams(SearchTextQuery textQuery, DiscType discType, int start, int maxResults, bool getTotalCount,
                                AlbumSortRule sortRule = AlbumSortRule.Name, bool moveExactToTop = false)
        {
            Common = new CommonSearchParams(textQuery, false, moveExactToTop);
            Paging = new PagingProperties(start, maxResults, getTotalCount);

            AlbumType = discType;
            SortRule  = sortRule;
        }
Esempio n. 12
0
        public AlbumQueryParams(string query, DiscType discType, int start, int maxResults, bool draftsOnly, bool getTotalCount,
                                NameMatchMode nameMatchMode = NameMatchMode.Auto, AlbumSortRule sortRule = AlbumSortRule.Name, bool moveExactToTop = false)
        {
            Common = new CommonSearchParams(query, draftsOnly, nameMatchMode, false, moveExactToTop);
            Paging = new PagingProperties(start, maxResults, getTotalCount);

            AlbumType = discType;
            SortRule  = sortRule;
        }
Esempio n. 13
0
        public AlbumQueryParams(string query, DiscType discType, int start, int maxResults, bool draftsOnly, bool getTotalCount,
            NameMatchMode nameMatchMode = NameMatchMode.Auto, AlbumSortRule sortRule = AlbumSortRule.Name, bool moveExactToTop = false)
        {
            Common = new CommonSearchParams(query, draftsOnly, nameMatchMode, false, moveExactToTop);
            Paging = new PagingProperties(start, maxResults, getTotalCount);

            AlbumType = discType;
            SortRule = sortRule;
        }
Esempio n. 14
0
        public static IQueryable <Album> WhereHasType(this IQueryable <Album> query, DiscType albumType)
        {
            if (albumType == DiscType.Unknown)
            {
                return(query);
            }

            return(query.Where(m => m.DiscType == albumType));
        }
Esempio n. 15
0
        public ActionResult Index(string query, DiscType discType = DiscType.Unknown,
                                  int start = 0, bool getTotalCount = false, AlbumSortRule sort = AlbumSortRule.Name,
                                  NameMatchMode nameMatchMode = NameMatchMode.Exact, DataFormat format = DataFormat.Auto)
        {
            var queryParams = new AlbumQueryParams(query, discType, start, maxResults, false, getTotalCount, nameMatchMode, sort);

            var entries = Service.Find(a => new AlbumForApiContract(a, LoginManager.LanguagePreference), queryParams);

            return(Object(entries, format));
        }
Esempio n. 16
0
        public ActionResult Index(string query, DiscType discType = DiscType.Unknown,
            int start = 0, bool getTotalCount = false, AlbumSortRule sort = AlbumSortRule.Name,
            NameMatchMode nameMatchMode = NameMatchMode.Exact, DataFormat format = DataFormat.Auto)
        {
            var queryParams = new AlbumQueryParams(query, discType, start, maxResults, false, getTotalCount, nameMatchMode, sort);

            var entries = Service.Find(a => new AlbumForApiContract(a, LoginManager.LanguagePreference), queryParams);

            return Object(entries, format);
        }
Esempio n. 17
0
        public PartialFindResult <AlbumForApiContract> GetList(
            string query               = "",
            DiscType discTypes         = DiscType.Unknown,
            [FromUri] string[] tagName = null,
            [FromUri] int[] tagId      = null,
            bool childTags             = false,
            [FromUri] int[] artistId   = null,
            ArtistAlbumParticipationStatus artistParticipationStatus = ArtistAlbumParticipationStatus.Everything,
            bool childVoicebanks       = false,
            bool includeMembers        = false,
            string barcode             = null,
            EntryStatus?status         = null,
            DateTime?releaseDateAfter  = null,
            DateTime?releaseDateBefore = null,
            [FromUri] AdvancedSearchFilter[] advancedFilters = null,
            int start                      = 0,
            int maxResults                 = defaultMax,
            bool getTotalCount             = false,
            AlbumSortRule?sort             = null,
            bool preferAccurateMatches     = false,
            bool deleted                   = false,
            NameMatchMode nameMatchMode    = NameMatchMode.Exact,
            AlbumOptionalFields fields     = AlbumOptionalFields.None,
            ContentLanguagePreference lang = ContentLanguagePreference.Default)
        {
            var textQuery = SearchTextQuery.Create(query, nameMatchMode);

            var queryParams = new AlbumQueryParams(textQuery, discTypes, start, Math.Min(maxResults, absoluteMax), getTotalCount, sort ?? AlbumSortRule.Name, preferAccurateMatches)
            {
                ArtistParticipation =
                {
                    ArtistIds       = artistId,
                    Participation   = artistParticipationStatus,
                    ChildVoicebanks = childVoicebanks,
                    IncludeMembers  = includeMembers
                },
                Tags               = tagName,
                TagIds             = tagId,
                ChildTags          = childTags,
                Barcode            = barcode,
                Deleted            = deleted,
                ReleaseDateAfter   = releaseDateAfter,
                ReleaseDateBefore  = releaseDateBefore,
                AdvancedFilters    = advancedFilters,
                LanguagePreference = lang
            };

            queryParams.Common.EntryStatus = status;

            var ssl = WebHelper.IsSSL(Request);

            var entries = service.Find(a => new AlbumForApiContract(a, null, lang, thumbPersister, ssl, fields, SongOptionalFields.None), queryParams);

            return(entries);
        }
Esempio n. 18
0
 internal ExtractedFile(DiscType discType, string discId8, string partitionId, long offset, long length, string path, string name, ExtractedFileType type)
 {
     DiscType    = discType;
     DiscId8     = discId8;
     PartitionId = partitionId;
     Offset      = offset;
     Length      = length;
     Path        = path;
     Name        = name;
     Type        = type;
 }
Esempio n. 19
0
    public void SetIcon(int indexSprite, int number)
    {
        RefreshImage(indexSprite);
        textValue.text = number.ToString();

        discType = (DiscType)indexSprite;

        tooltipCollider.SetTooltipInformations(TooltipInformationFactory.GetDiscTypeInformations(DiscManager.Instance.GetDiscInformations(discType),
                                                                                                 tooltipCollider.GetTooltipInformations.forcedTooltipLPosition, tooltipCollider.GetTooltipInformations.tooltipForcedPositionType));
        tooltipCollider.SetTooltipable(discType != DiscType.None);
    }
Esempio n. 20
0
File: Disc.cs Progetto: ruvor/Atapy
        public Disc(DiscType type, string barcode )
        {
            if (type == DiscType.CD)
                size = sizeCD;
            else
                size = sizeDVD;

            GoodType = CategoryHelper.CreateCategory("Диски");
            GoodCategory = CategoryHelper.CreateCategory(type.ToString(), GoodType.Id);
            Barcode = barcode;
        }
Esempio n. 21
0
 void DrawAngleProperties(DiscType selectedType)
 {
     using (new EditorGUI.DisabledScope(selectedType.HasSector() == false && serializedObject.isEditingMultipleObjects == false)) {
         ShapesUI.AngleProperty(propAngRadiansStart, "Angle start", propAngUnitInput, angLabelLayout);
         ShapesUI.AngleProperty(propAngRadiansEnd, "Angle end", propAngUnitInput, angLabelLayout);
         GUILayout.BeginHorizontal();
         EditorGUILayout.PrefixLabel(" ");
         GUIContent[] angLabels = (Screen.width < 300) ? ShapesAssets.AngleUnitButtonContentsShort : ShapesAssets.AngleUnitButtonContents;
         ShapesUI.DrawTypeSwitchButtons(propAngUnitInput, angLabels, 15);
         GUILayout.EndHorizontal();
     }
 }
Esempio n. 22
0
        public override void OnInspectorGUI()
        {
            base.BeginProperties(showColor: false);

            // Color properties
            EditorGUILayout.PropertyField(propColorMode);
            switch ((Disc.DiscColorMode)propColorMode.enumValueIndex)
            {
            case Disc.DiscColorMode.Single:
                base.PropertyFieldColor();
                break;

            case Disc.DiscColorMode.Radial:
                base.PropertyFieldColor("Inner");
                EditorGUILayout.PropertyField(propColorOuterStart, new GUIContent("Outer"));
                break;

            case Disc.DiscColorMode.Angular:
                base.PropertyFieldColor("Start");
                EditorGUILayout.PropertyField(propColorInnerEnd, new GUIContent("End"));
                break;

            case Disc.DiscColorMode.Bilinear:
                base.PropertyFieldColor("Inner Start");
                EditorGUILayout.PropertyField(propColorOuterStart, new GUIContent("Outer Start"));
                EditorGUILayout.PropertyField(propColorInnerEnd, new GUIContent("Inner End"));
                EditorGUILayout.PropertyField(propColorOuterEnd, new GUIContent("Outer End"));
                break;
            }

            using (new EditorGUILayout.HorizontalScope()) {
                EditorGUILayout.PrefixLabel("Type");
                ShapesUI.DrawTypeSwitchButtons(propType, ShapesAssets.DiscTypeButtonContents, 20);
            }

            DiscType selectedType = (DiscType)propType.enumValueIndex;

            if (propType.enumValueIndex == (int)DiscType.Arc)
            {
                ShapesUI.EnumToggleProperty(propArcEndCaps, "Round Caps");
            }
            ShapesUI.FloatInSpaceField(propRadius, propRadiusSpace);
            using (new EditorGUI.DisabledScope(selectedType.HasThickness() == false && serializedObject.isEditingMultipleObjects == false))
                ShapesUI.FloatInSpaceField(propThickness, propThicknessSpace);
            DrawAngleProperties(selectedType);

            ShapesUI.BeginGroup();
            dashEditor.DrawProperties();
            ShapesUI.EndGroup();

            base.EndProperties();
        }
Esempio n. 23
0
        public ActionResult Index(string query, DiscType discType = DiscType.Unknown,
            int start = 0, bool getTotalCount = false, AlbumSortRule sort = AlbumSortRule.Name,
            NameMatchMode nameMatchMode = NameMatchMode.Exact,
            bool includeArtists = true, bool includeNames = true, bool includePVs = false, bool includeTags = true, bool includeWebLinks = false,
            DataFormat format = DataFormat.Auto,
            ContentLanguagePreference lang = ContentLanguagePreference.Default)
        {
            var queryParams = new AlbumQueryParams(query, discType, start, maxResults, false, getTotalCount, nameMatchMode, sort);

            var entries = Service.Find(a => new AlbumForApiContract(a, null, lang, includeArtists, includeNames, includePVs, includeTags, includeWebLinks), queryParams);

            return Object(entries, format);
        }
Esempio n. 24
0
 public Index(PartialFindResult<AlbumContract> result, string filter, DiscType discType, 
     AlbumSortRule sortRule, EntryViewMode view, int? page, bool? draftsOnly, IndexRouteParams routeParams)
 {
     Page = page ?? 1;
     Albums = new StaticPagedList<AlbumContract>(result.Items,
         Page, 30, result.TotalCount);
     DiscType = discType;
     DraftsOnly = draftsOnly ?? false;
     Filter = filter;
     Sort = sortRule;
     View = view;
     RouteParams = routeParams;
 }
Esempio n. 25
0
 public Index(PartialFindResult <AlbumContract> result, string filter, DiscType discType,
              AlbumSortRule sortRule, EntryViewMode view, int?page, bool?draftsOnly, IndexRouteParams routeParams)
 {
     Page   = page ?? 1;
     Albums = new StaticPagedList <AlbumContract>(result.Items,
                                                  Page, 30, result.TotalCount);
     DiscType    = discType;
     DraftsOnly  = draftsOnly ?? false;
     Filter      = filter;
     Sort        = sortRule;
     View        = view;
     RouteParams = routeParams;
 }
Esempio n. 26
0
        public ActionResult Index(string query, DiscType discType = DiscType.Unknown,
                                  int start = 0, bool getTotalCount = false, AlbumSortRule sort = AlbumSortRule.Name,
                                  NameMatchMode nameMatchMode    = NameMatchMode.Exact,
                                  bool includeArtists            = true, bool includeNames = true, bool includePVs = false, bool includeTags = true, bool includeWebLinks = false,
                                  DataFormat format              = DataFormat.Auto,
                                  ContentLanguagePreference lang = ContentLanguagePreference.Default)
        {
            var queryParams = new AlbumQueryParams(query, discType, start, maxResults, false, getTotalCount, nameMatchMode, sort);

            var entries = Service.Find(a => new AlbumForApiContract(a, null, lang, includeArtists, includeNames, includePVs, includeTags, includeWebLinks), queryParams);

            return(Object(entries, format));
        }
Esempio n. 27
0
        public static ContentFocus GetContentFocus(DiscType t)
        {
            switch (t)
            {
            case DiscType.Artbook:
                return(ContentFocus.Illustration);

            case DiscType.Video:
                return(ContentFocus.Video);

            default:
                return(ContentFocus.Music);
            }
        }
Esempio n. 28
0
    public EnemyBase SpawnEnemyAtPosition(EnemyType enemyType, Vector3 position, DiscType lootedDiscType)
    {
        EnemyBase newEnemy = GetEnemyFromPool(enemyType);

        if (newEnemy == null)
        {
            return(null);
        }

        newEnemy.SpawnEnemy(position, lootedDiscType);
        AddEnemy(newEnemy);

        return(newEnemy);
    }
    public override void UpdateData()
    {
        if (poly == null)
        {
            return;
        }

        type        = disc.Type;
        cap         = disc.ArcEndCaps;
        radius      = disc.Radius;
        thickness   = disc.Thickness;
        angRadStart = disc.AngRadiansStart;
        angRadEnd   = disc.AngRadiansEnd;
        Refresh(type, radius, thickness, angRadStart, angRadEnd);
    }
Esempio n. 30
0
    public void StartSpawning(EnemyType enemyTypeToSpawn, bool autoDetectPlayer, DiscType lootedDiscType)
    {
        if (enemyTypeToSpawn == EnemyType.None)
        {
            return;
        }
        spawnPendingEnemyType            = enemyTypeToSpawn;
        spawnPendingWillAutoDetectPlayer = autoDetectPlayer;
        spawnPendingLootedDiscType       = lootedDiscType;

        TurnManager.Instance.AddPendingSpawnPoint(this);
        //spawnZoneDebugObject.SetActive(true);
        fxGameObject = FxManager.Instance.SendFx(FxType.enemySpawnPreparation, gameObject.transform.position + Vector3.up * 0.01f);
        tooltipCollider.gameObject.SetActive(true);
        fxGameObject.SetActive(true);
    }
Esempio n. 31
0
    public void ReturnDiscInPool(DiscScript disc)
    {
        DiscType discType = disc.GetDiscType;

        disc.gameObject.SetActive(false);

        inGameDiscs.Remove(disc);
        if (allDiscPools.ContainsKey(discType))
        {
            allDiscPools[discType].Enqueue(disc);
        }
        else
        {
            Destroy(disc.gameObject);
        }
    }
Esempio n. 32
0
        public IActionResult DiscTypeAdd()
        {
            int id;

            try
            {
                id = _context.DiscTypes.Max(d => d.DiscTypeId) + 1;
            }
            catch
            {
                id = 1;
            }
            DiscType discType = new DiscType();

            discType.DiscTypeId = id;
            return(View(discType));
        }
Esempio n. 33
0
    void Awake()
    {
        TCForce[] forces = GetComponents <TCForce>();

        if (this != forces[0])
        {
            if (forces[0].IsGlobalShape)
            {
                shape        = forces[0].shape;
                radius       = forces[0].radius;
                boxSize      = forces[0].boxSize;
                height       = forces[0].height;
                discHeight   = forces[0].discHeight;
                discRounding = forces[0].discRounding;
                discType     = forces[0].discType;
            }
        }
        m_rigidbody = GetComponent <Rigidbody>();
    }
Esempio n. 34
0
    public DiscInformations GetDiscInformations(DiscType discType)
    {
        if (discInformations.Count == 0)
        {
            return(null);
        }

        if (discsDictionnary.Count == 0)
        {
            GenerateDiscsDictionary();
        }

        if (discsDictionnary.ContainsKey(discType))
        {
            return(discsDictionnary[discType]);
        }

        return(null);
    }
Esempio n. 35
0
    public void PlayerRetreiveDisc(DiscScript retreivedDisc)
    {
        SoundManager.Instance.PlaySound(Sound.RecallDisc, player.transform.position);

        throwedDiscs.Remove(retreivedDisc);
        ReturnDiscInPool(retreivedDisc);
        if (possessedDiscs.Count < maxNumberOfPossessedDiscs)
        {
            possessedDiscs.Push(retreivedDisc.GetDiscType);
            OnDiscAdded?.Invoke(retreivedDisc);
            OnDiscUpdate?.Invoke(possessedDiscs);
        }
        else
        {
            DiscType retreivedDiscType = retreivedDisc.GetDiscType;
            DiscOverload(retreivedDiscType);
            //Debug.Log("TOO MUCH DISCS, NOT ADDED BUT SUPPOSED TO BE SOMETHING");
        }

        GameManager.Instance.CheckForCompetencesUsability();
    }
Esempio n. 36
0
 public DVD(bool isoneside, string name, string model)
 {
     if (isoneside == true)
     {
         discType       = DiscType.oneside;
         memorySizeMB   = 4.7 * 1024;
         Name           = name;
         Model          = model;
         seizedMemoryMB = 0;
         freeMemoryMB   = memorySizeMB;
     }
     else
     {
         discType       = DiscType.bothside;
         memorySizeMB   = 9 * 1024;
         Name           = name;
         Model          = model;
         seizedMemoryMB = 0;
         freeMemoryMB   = memorySizeMB;
     }
 }
        public DiscDataEx(DiscData disc, int slotId, int changerId)
        {
            this.DiscId = disc.DiscId;
            this.DiscType = disc.DiscType;
            this.DrivePath = disc.DrivePath;
            this.VolumeLabel = disc.VolumeLabel;
            this.SlotId = slotId;
            this.ChangerId = changerId;

            if (disc.DiscType == DiscType.MovieDvd)
            {
                //load additional movie crud
                this.Director = this.GetMetaString(disc.MediaMetadata, "Director");
                this.Title = this.GetMetaString(disc.MediaMetadata, "Title");
                this.ReleaseDate = this.GetMetaString(disc.MediaMetadata, "ReleaseDate");
                this.MPAARating = this.GetMetaString(disc.MediaMetadata, "MPAARating");
                this.Duration = this.GetMetaString(disc.MediaMetadata, "Duration");
            }
        }
Esempio n. 38
0
        public PartialFindResult<AlbumForApiContract> GetList(
            string query = "",
            DiscType discTypes = DiscType.Unknown,
            string tag = null,
            int? artistId = null,
            ArtistAlbumParticipationStatus artistParticipationStatus = ArtistAlbumParticipationStatus.Everything,
            bool childVoicebanks = false,
            string barcode = null,
            EntryStatus? status = null,
            int start = 0,
            int maxResults = defaultMax,
            bool getTotalCount = false,
            AlbumSortRule? sort = null,
            NameMatchMode nameMatchMode = NameMatchMode.Exact,
            AlbumOptionalFields fields = AlbumOptionalFields.None,
            ContentLanguagePreference lang = ContentLanguagePreference.Default)
        {
            query = FindHelpers.GetMatchModeAndQueryForSearch(query, ref nameMatchMode);

            var queryParams = new AlbumQueryParams(query, discTypes, start, Math.Min(maxResults, absoluteMax), false, getTotalCount, nameMatchMode, sort ?? AlbumSortRule.Name) {
                Tag = tag,
                ArtistId = artistId ?? 0,
                ArtistParticipationStatus = artistParticipationStatus,
                ChildVoicebanks = childVoicebanks,
                Barcode = barcode
            };
            queryParams.Common.EntryStatus = status;

            var ssl = WebHelper.IsSSL(Request);

            var entries = service.Find(a => new AlbumForApiContract(a, null, lang, thumbPersister, ssl, fields), queryParams);

            return entries;
        }
Esempio n. 39
0
 public static string DiscTypeName(DiscType discType)
 {
     return DiscTypeNames.ResourceManager.GetString(discType.ToString());
 }
		public static IQueryable<Album> WhereHasType(this IQueryable<Album> query, DiscType albumType) {

			if (albumType == DiscType.Unknown)
				return query;

			return query.Where(m => m.DiscType == albumType);

		}
Esempio n. 41
0
 public static bool IsAnimation(DiscType t)
 {
     return (t == DiscType.Video);
 }