# \[F\] False duplicate detection in loop limit

**URL:** https://community.mp3tag.de/t/f-false-duplicate-detection-in-loop-limit/15609
**Category:** Fixed Bugs
**Tags:** bug-fixed
**Created:** [March 23, 2014, 12:03am UTC](https://community.mp3tag.de/t/f-false-duplicate-detection-in-loop-limit/15609 "2014-03-23T00:03:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [March 23, 2014, 12:03am UTC](https://community.mp3tag.de/t/f-false-duplicate-detection-in-loop-limit/15609/1 "2014-03-23T00:03:00Z")

</div>

Help [https://docs.mp3tag.de/export](https://docs.mp3tag.de/export) says:

> [@](#):
>
> If you want to limit the loop output to a certain number of entries, simply use $loop(%fieldname%,num). This is useful to eliminate duplicate records (num=1).

yet here only one of the two (non-duplicate) titles gets output:

ISTM program is comparing case-insensitively and either the program or the Help ("duplicate") is incorrect.

If anyone knows a workaround, please say.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [March 23, 2014, 7:51am UTC](https://community.mp3tag.de/t/f-false-duplicate-detection-in-loop-limit/15609/2 "2014-03-23T07:51:06Z")

</div>

> [@chrisjj](#):
>
> ... ISTM program is comparing case-insensitively and either the program or the Help ("duplicate") is incorrect.  
> If anyone knows a workaround, please say.

There is a workaround which can detect differences in lower / upper case, ...  
but cannot handle diacritics.

\_\_Export.loop.case.respect.mte ( 845bytes ) Number of downloads: 1

[\_\_Export.loop.case.respect.mte](https://community.mp3tag.de/uploads/default/original/2X/7/7df3b2db5f3bc3b60f984a7cdbc144e39a1c4d5d.mte) (1.15 KB)  
DD.20140323.0953.CET

[\_\_Export.loop.case.respect.mte](https://community.mp3tag.de/uploads/default/original/2X/7/7df3b2db5f3bc3b60f984a7cdbc144e39a1c4d5d.mte) (1.15 KB)

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [March 23, 2014, 9:31pm UTC](https://community.mp3tag.de/t/f-false-duplicate-detection-in-loop-limit/15609/3 "2014-03-23T21:31:47Z")

</div>

> [@DetlevD](#):
>
> There is a workaround which can detect differences in lower / upper case, ...  
> but cannot differentiate diacritics.
> 
> \_\_Export.loop.case.respect.mte ( 845bytes ) Number of downloads: 1

Thanks, D. In my sample script given, I replaced

```
 $loop(%title%,1)

```

with your

```
 $loop(%TITLE%$regexp($regexp(%TITLE%,'\l','0'),'\u','1'),1)

```

and that gave case-insensitivity as I required.

Re diacritics, my full script is is intended to output a playlist containing all tracks showing deviation in title, e.g. having title differing from that of any track in presence/absence of (Spanish) diacritics or any character other than letters or digits, or letter case. With your case fix, that script is now:

```
#EXTM3U
$loop($regexp($replace($lower(%title%),á,a,é,e,í,i,ó,o,ú,u,n,ñ),'[^a-zA-Z0-9]',))$loop(%TITLE%$regexp($regexp(%TITLE%,'\l','0'),'\u','1'),1)$loopend()$ifgreater(%_max_counter%,1,$loop(%title%)#EXTINF:%_lentgh%,%artist% - %title%
%_path%
$loopend()
,)$loopend()

```

From this list of titles

```
A bailar
A bailar
Adios muchachos
Adios, muchachos
Chique
Chiqué
La Cumparsita
La cumparsita
Vida Mía
Vida mía

```

it puts these in a EXTM3U playlist

```
Adios muchachos
Adios, muchachos
Chique
Chiqué
La Cumparsita
La cumparsita
Vida Mía
Vida mía

```

.

I then load the playlist into Mp3tag for manual correction of the faulty titles.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [April 20, 2014, 8:27am UTC](https://community.mp3tag.de/t/f-false-duplicate-detection-in-loop-limit/15609/4 "2014-04-20T08:27:46Z")

</div>

I've fixed this with Mp3tag v2.59.

```
[2014-04-13] FIX: export field parameter at $loop() was compared case-insensitive which caused unexpected behavior at duplicate detection.

```

Thanks for reporting!

Kind regards  
Florian

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [April 22, 2014, 11:07pm UTC](https://community.mp3tag.de/t/f-false-duplicate-detection-in-loop-limit/15609/5 "2014-04-22T23:07:51Z")

</div>

Thanks.

FTR, this makes V2.59 incompatible with previous versions when performing some export configs.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [December 28, 2018, 2:06pm UTC](https://community.mp3tag.de/t/f-false-duplicate-detection-in-loop-limit/15609/6 "2018-12-28T14:06:59Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
